mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
New: Newznab providers will be rejected if they are not valid addresses.
Tests added for checking DNS.
This commit is contained in:
parent
7e5445fa3a
commit
7a80c81ffb
3 changed files with 47 additions and 3 deletions
|
@ -9,6 +9,7 @@ using NzbDrone.Core.Providers;
|
|||
using NzbDrone.Core.Repository;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Test.Common;
|
||||
using NzbDrone.Test.Common.AutoMoq;
|
||||
|
||||
namespace NzbDrone.Core.Test.ProviderTests
|
||||
|
@ -295,5 +296,19 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
var result = db.Fetch<NewznabDefinition>();
|
||||
result.Should().HaveCount(2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CheckHostname_should_do_nothing_if_hostname_is_valid()
|
||||
{
|
||||
Mocker.Resolve<NewznabProvider>().CheckHostname("http://www.google.com");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException("System.Net.Sockets.SocketException")]
|
||||
public void CheckHostname_should_log_error_and_throw_exception_if_dnsHostname_is_invalid()
|
||||
{
|
||||
Mocker.Resolve<NewznabProvider>().CheckHostname("http://BadName");
|
||||
ExceptionVerification.ExpectedErrors(1);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue