mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
Fixed: Regression preventing new downloads from bypassing the Download Client Back-off logic
This commit is contained in:
@@ -204,18 +204,26 @@ namespace NzbDrone.Core.Test.Download
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_attempt_download_if_client_is_disabled()
|
||||
public void should_attempt_download_even_if_client_is_disabled()
|
||||
{
|
||||
WithUsenetClient();
|
||||
var mockUsenet = WithUsenetClient();
|
||||
|
||||
Mocker.GetMock<IDownloadClientStatusService>()
|
||||
.Setup(v => v.IsDisabled(It.IsAny<int>()))
|
||||
.Returns(true);
|
||||
.Setup(v => v.GetBlockedProviders())
|
||||
.Returns(new List<DownloadClientStatus>
|
||||
{
|
||||
new DownloadClientStatus
|
||||
{
|
||||
ProviderId = _downloadClients.First().Definition.Id,
|
||||
DisabledTill = DateTime.UtcNow.AddHours(3)
|
||||
}
|
||||
});
|
||||
|
||||
Assert.Throws<DownloadClientUnavailableException>(() => Subject.DownloadReport(_parseResult));
|
||||
Subject.DownloadReport(_parseResult);
|
||||
|
||||
Mocker.GetMock<IDownloadClient>().Verify(c => c.Download(It.IsAny<RemoteAlbum>()), Times.Never());
|
||||
VerifyEventNotPublished<AlbumGrabbedEvent>();
|
||||
Mocker.GetMock<IDownloadClientStatusService>().Verify(c => c.GetBlockedProviders(), Times.Never());
|
||||
mockUsenet.Verify(c => c.Download(It.IsAny<RemoteAlbum>()), Times.Once());
|
||||
VerifyEventPublished<AlbumGrabbedEvent>();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user