mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-24 16:53:54 +00:00
Better check against internal server error exceptions during unit tests.
This commit is contained in:
parent
67298d62a0
commit
11db27f6ac
4 changed files with 11 additions and 9 deletions
|
@ -399,6 +399,7 @@ namespace NzbDrone.Core.Test
|
|||
ExceptionVerification.MarkInconclusive(typeof(WebException));
|
||||
ExceptionVerification.MarkInconclusive("System.Net.WebException");
|
||||
ExceptionVerification.MarkInconclusive("(503) Server Unavailable.");
|
||||
ExceptionVerification.MarkInconclusive("(500) Internal Server Error.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,25 +99,25 @@ namespace NzbDrone.Core.Providers.Indexer
|
|||
|
||||
public virtual IList<EpisodeParseResult> FetchSeason(string seriesTitle, int seasonNumber)
|
||||
{
|
||||
_logger.Debug("Searching {0} for {1}-Season {2}", Name, seriesTitle, seasonNumber);
|
||||
_logger.Debug("Searching {0} for {1} Season {2}", Name, seriesTitle, seasonNumber);
|
||||
|
||||
var searchUrls = GetSeasonSearchUrls(GetQueryTitle(seriesTitle), seasonNumber);
|
||||
var result = Fetch(searchUrls);
|
||||
|
||||
_logger.Info("Finished searching {0} for {1}-S{2}, Found {3}", Name, seriesTitle, seasonNumber, result.Count);
|
||||
_logger.Info("Finished searching {0} for {1} Season {2}, Found {3}", Name, seriesTitle, seasonNumber, result.Count);
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual IList<EpisodeParseResult> FetchPartialSeason(string seriesTitle, int seasonNumber, int episodePrefix)
|
||||
{
|
||||
_logger.Debug("Searching {0} for {1}-Season {2}, Prefix: {3}", Name, seriesTitle, seasonNumber, episodePrefix);
|
||||
_logger.Debug("Searching {0} for {1} Season {2}, Prefix: {3}", Name, seriesTitle, seasonNumber, episodePrefix);
|
||||
|
||||
|
||||
var searchUrls = GetPartialSeasonSearchUrls(GetQueryTitle(seriesTitle), seasonNumber, episodePrefix);
|
||||
|
||||
var result = Fetch(searchUrls);
|
||||
|
||||
_logger.Info("Finished searching {0} for {1}-S{2}, Found {3}", Name, seriesTitle, seasonNumber, result.Count);
|
||||
_logger.Info("Finished searching {0} for {1} Season {2}, Found {3}", Name, seriesTitle, seasonNumber, result.Count);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ namespace NzbDrone.Core.Providers.Indexer
|
|||
|
||||
var result = Fetch(searchUrls);
|
||||
|
||||
_logger.Info("Finished searching {0} for {1}-S{2}E{3:00}, Found {4}", Name, seriesTitle, seasonNumber, episodeNumber, result.Count);
|
||||
_logger.Info("Finished searching {0} for {1} S{2:00}E{3:00}, Found {4}", Name, seriesTitle, seasonNumber, episodeNumber, result.Count);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
|
|
@ -78,19 +78,18 @@ namespace NzbDrone.Test.Common
|
|||
{
|
||||
var inconclusiveLogs = _logs.Where(l => l.Exception != null && l.Exception.GetType() == exception).ToList();
|
||||
|
||||
if (inconclusiveLogs.Count != 0)
|
||||
if (inconclusiveLogs.Any())
|
||||
{
|
||||
inconclusiveLogs.ForEach(c => _logs.Remove(c));
|
||||
Assert.Inconclusive(GetLogsString(inconclusiveLogs));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void MarkInconclusive(string text)
|
||||
{
|
||||
var inconclusiveLogs = _logs.Where(l => l.FormattedMessage.Contains(text)).ToList();
|
||||
var inconclusiveLogs = _logs.Where(l => l.FormattedMessage.ToLower().Contains(text.ToLower())).ToList();
|
||||
|
||||
if (inconclusiveLogs.Count != 0)
|
||||
if (inconclusiveLogs.Any())
|
||||
{
|
||||
inconclusiveLogs.ForEach(c => _logs.Remove(c));
|
||||
Assert.Inconclusive(GetLogsString(inconclusiveLogs));
|
||||
|
|
|
@ -71,6 +71,8 @@
|
|||
background: lightgray;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.episodeMissing
|
||||
{
|
||||
background-color: #f5c5c5;
|
||||
|
|
Loading…
Reference in a new issue