Fixed: Jackett indexer search performance

This commit is contained in:
Taloth Saldono
2021-03-16 21:52:21 +00:00
committed by ta264
parent a6f8391f40
commit c8c37435be
3 changed files with 59 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common.Http;
namespace NzbDrone.Common.Test.Http
{
[TestFixture]
public class HttpRateLimitKeyFactoryFixture
{
[TestCase("http://127.0.0.2:9117/jackett/api/v2.0/indexers/viva/results/torznab/api?t=search&cat=5000,5070,100030,100041", "127.0.0.2:9117/jackett/api/v2.0/indexers/viva")]
public void should_detect_jackett(string url, string expectedKey)
{
var request = new HttpRequest(url);
var key = HttpRateLimitKeyFactory.GetRateLimitKey(request);
key.Should().Be(expectedKey);
}
[TestCase("http://127.0.0.2:9117/jackett", "127.0.0.2")]
public void should_default_to_host(string url, string expectedKey)
{
var request = new HttpRequest(url);
var key = HttpRateLimitKeyFactory.GetRateLimitKey(request);
key.Should().Be(expectedKey);
}
}
}