Beispiel #1
0
def verify_name_gen(curtest, tvdb_instance):
    ep = EpisodeInfo(
        seriesname=curtest["parsedseriesname"],
        seasonnumber=curtest["seasonnumber"],
        episodenumbers=curtest["episodenumbers"],
    )
    correctedSeriesName, epName = getEpisodeName(tvdb_instance, ep)

    assert correctedSeriesName is not None, "Corrected series name was none"
    assert epName is not None, "Episode name was None"

    assertEquals(epName, curtest["episodenames"])
    assertEquals(correctedSeriesName, curtest["correctedseriesname"])
def verify_name_gen(curtest, tvdb_instance):
    if "seasonnumber" in curtest:
        ep = EpisodeInfo(
            seriesname = curtest['parsedseriesname'],
            seasonnumber = curtest['seasonnumber'],
            episodenumbers = curtest['episodenumbers'])
    elif any([isinstance(x, datetime.date) for x in curtest['episodenumbers']]):
        ep = DatedEpisodeInfo(
            seriesname = curtest['parsedseriesname'],
            episodenumbers = curtest['episodenumbers'])
    else:
        ep = NoSeasonEpisodeInfo(
            seriesname = curtest['parsedseriesname'],
            episodenumbers = curtest['episodenumbers'])

    correctedSeriesName, epName = getEpisodeName(tvdb_instance, ep)

    assert correctedSeriesName is not None, "Corrected series name was none"
    assert epName is not None, "Episode name was None"

    assertEquals(epName, curtest['episodenames'])
    assertEquals(correctedSeriesName, curtest['correctedseriesname'])