Fixed: Regression in folder move logic preventing updater from working.
This commit is contained in:
parent
f215ba9bac
commit
cf327077e9
|
@ -813,6 +813,24 @@ namespace NzbDrone.Common.Test.DiskTests
|
||||||
.Verify(v => v.MoveFolder(src, dst), Times.Once());
|
.Verify(v => v.MoveFolder(src, dst), Times.Once());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TransferFolder_should_not_use_movefolder_if_on_same_mount_but_target_already_exists()
|
||||||
|
{
|
||||||
|
WithEmulatedDiskProvider();
|
||||||
|
|
||||||
|
var src = @"C:\Base1\TestDir1".AsOsAgnostic();
|
||||||
|
var dst = @"C:\Base1\TestDir2".AsOsAgnostic();
|
||||||
|
|
||||||
|
WithMockMount(@"C:\Base1".AsOsAgnostic());
|
||||||
|
WithExistingFile(@"C:\Base1\TestDir1\test.file.txt".AsOsAgnostic());
|
||||||
|
WithExistingFolder(dst);
|
||||||
|
|
||||||
|
Subject.TransferFolder(src, dst, TransferMode.Move);
|
||||||
|
|
||||||
|
Mocker.GetMock<IDiskProvider>()
|
||||||
|
.Verify(v => v.MoveFolder(src, dst), Times.Never());
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TransferFolder_should_not_use_movefolder_if_on_same_mount_but_transactional()
|
public void TransferFolder_should_not_use_movefolder_if_on_same_mount_but_transactional()
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace NzbDrone.Common.Disk
|
||||||
Ensure.That(sourcePath, () => sourcePath).IsValidPath();
|
Ensure.That(sourcePath, () => sourcePath).IsValidPath();
|
||||||
Ensure.That(targetPath, () => targetPath).IsValidPath();
|
Ensure.That(targetPath, () => targetPath).IsValidPath();
|
||||||
|
|
||||||
if (mode == TransferMode.Move)
|
if (mode == TransferMode.Move && !_diskProvider.FolderExists(targetPath))
|
||||||
{
|
{
|
||||||
if (verificationMode == DiskTransferVerificationMode.TryTransactional || verificationMode == DiskTransferVerificationMode.VerifyOnly)
|
if (verificationMode == DiskTransferVerificationMode.TryTransactional || verificationMode == DiskTransferVerificationMode.VerifyOnly)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue