mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-27 22:56:45 -04:00
New: Drone now uses the Download Client API to determine if a download is ready for import. (User configuration is required to replace the drone factory with this feature)
This commit is contained in:
@@ -137,7 +137,7 @@ namespace NzbDrone.Common.Test.DiskProviderTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void move_read_only_file()
|
||||
public void should_be_able_to_move_read_only_file()
|
||||
{
|
||||
var source = GetTempFilePath();
|
||||
var destination = GetTempFilePath();
|
||||
@@ -151,6 +151,23 @@ namespace NzbDrone.Common.Test.DiskProviderTests
|
||||
Subject.MoveFile(source, destination);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_be_able_to_delete_directory_with_read_only_file()
|
||||
{
|
||||
var sourceDir = GetTempFilePath();
|
||||
var source = Path.Combine(sourceDir, "test.txt");
|
||||
|
||||
Directory.CreateDirectory(sourceDir);
|
||||
|
||||
Subject.WriteAllText(source, "SourceFile");
|
||||
|
||||
File.SetAttributes(source, FileAttributes.ReadOnly);
|
||||
|
||||
Subject.DeleteFolder(sourceDir, true);
|
||||
|
||||
Directory.Exists(sourceDir).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void empty_folder_should_return_folder_modified_date()
|
||||
{
|
||||
|
||||
@@ -5,32 +5,7 @@ using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Common.Test.DiskProviderTests
|
||||
{
|
||||
public class IsParentFixture : TestBase
|
||||
public class IsParentPathFixture : TestBase
|
||||
{
|
||||
private string _parent = @"C:\Test".AsOsAgnostic();
|
||||
|
||||
[Test]
|
||||
public void should_return_false_when_not_a_child()
|
||||
{
|
||||
var path = @"C:\Another Folder".AsOsAgnostic();
|
||||
|
||||
DiskProviderBase.IsParent(_parent, path).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_true_when_folder_is_parent_of_another_folder()
|
||||
{
|
||||
var path = @"C:\Test\TV".AsOsAgnostic();
|
||||
|
||||
DiskProviderBase.IsParent(_parent, path).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_true_when_folder_is_parent_of_a_file()
|
||||
{
|
||||
var path = @"C:\Test\30.Rock.S01E01.Pilot.avi".AsOsAgnostic();
|
||||
|
||||
DiskProviderBase.IsParent(_parent, path).Should().BeTrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user