mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Disabled verified file transfer on windows.
This commit is contained in:
parent
5effca92b8
commit
546f4ab577
2 changed files with 42 additions and 1 deletions
|
@ -47,10 +47,24 @@ namespace NzbDrone.Common.Test.DiskTests
|
|||
Assert.Throws<IOException>(() => Subject.TransferFile(_sourcePath, _targetPath, TransferMode.HardLink));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_use_verified_transfer_on_windows()
|
||||
{
|
||||
WindowsOnly();
|
||||
|
||||
var result = Subject.TransferFile(_sourcePath, _targetPath, TransferMode.Move);
|
||||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
.Verify(v => v.TryCreateHardLink(_sourcePath, _backupPath), Times.Never());
|
||||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
.Verify(v => v.MoveFile(_sourcePath, _targetPath, false), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_retry_if_partial_copy()
|
||||
{
|
||||
WithSuccessfulHardlink(_sourcePath, _backupPath);
|
||||
MonoOnly();
|
||||
|
||||
var retry = 0;
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
|
@ -69,6 +83,8 @@ namespace NzbDrone.Common.Test.DiskTests
|
|||
[Test]
|
||||
public void should_retry_twice_if_partial_copy()
|
||||
{
|
||||
MonoOnly();
|
||||
|
||||
var retry = 0;
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
.Setup(v => v.CopyFile(_sourcePath, _tempTargetPath, false))
|
||||
|
@ -87,6 +103,8 @@ namespace NzbDrone.Common.Test.DiskTests
|
|||
[Test]
|
||||
public void should_hardlink_before_move()
|
||||
{
|
||||
MonoOnly();
|
||||
|
||||
WithSuccessfulHardlink(_sourcePath, _backupPath);
|
||||
|
||||
var result = Subject.TransferFile(_sourcePath, _targetPath, TransferMode.Move);
|
||||
|
@ -98,6 +116,8 @@ namespace NzbDrone.Common.Test.DiskTests
|
|||
[Test]
|
||||
public void should_remove_source_after_move()
|
||||
{
|
||||
MonoOnly();
|
||||
|
||||
WithSuccessfulHardlink(_sourcePath, _backupPath);
|
||||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
|
@ -112,6 +132,8 @@ namespace NzbDrone.Common.Test.DiskTests
|
|||
[Test]
|
||||
public void should_remove_backup_if_move_throws()
|
||||
{
|
||||
MonoOnly();
|
||||
|
||||
WithSuccessfulHardlink(_sourcePath, _backupPath);
|
||||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
|
@ -126,6 +148,8 @@ namespace NzbDrone.Common.Test.DiskTests
|
|||
[Test]
|
||||
public void should_remove_partial_if_move_fails()
|
||||
{
|
||||
MonoOnly();
|
||||
|
||||
WithSuccessfulHardlink(_sourcePath, _backupPath);
|
||||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
|
@ -144,6 +168,8 @@ namespace NzbDrone.Common.Test.DiskTests
|
|||
[Test]
|
||||
public void should_fallback_to_copy_if_hardlink_failed()
|
||||
{
|
||||
MonoOnly();
|
||||
|
||||
WithFailedHardlink();
|
||||
|
||||
var result = Subject.TransferFile(_sourcePath, _targetPath, TransferMode.Move);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue