mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 02:22:31 +01:00
Better check against internal server error exceptions during unit tests.
This commit is contained in:
parent
67298d62a0
commit
11db27f6ac
@ -399,6 +399,7 @@ private static void Mark500Inconclusive()
|
||||
ExceptionVerification.MarkInconclusive(typeof(WebException));
|
||||
ExceptionVerification.MarkInconclusive("System.Net.WebException");
|
||||
ExceptionVerification.MarkInconclusive("(503) Server Unavailable.");
|
||||
ExceptionVerification.MarkInconclusive("(500) Internal Server Error.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,25 +99,25 @@ public virtual IList<EpisodeParseResult> FetchRss()
|
||||
|
||||
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 @@ public virtual IList<EpisodeParseResult> FetchEpisode(string seriesTitle, int se
|
||||
|
||||
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 @@ public static void MarkInconclusive(Type exception)
|
||||
{
|
||||
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 New Issue
Block a user