Пример #1
0
def test_no_series_number():
    """Episode without season number
    """
    ep = NoSeasonEpisodeInfo(seriesname='Scrubs',
                             episodenumbers=[2],
                             episodename='My Mentor',
                             filename=None)

    assertEquals(ep.generateFilename(), 'Scrubs - [02] - My Mentor')
Пример #2
0
def test_noseason_no_name_no_ext():
    """NoSeasonEpisodeInfo with no name or extension
    """
    ep = NoSeasonEpisodeInfo(seriesname='Scrubs',
                             episodenumbers=[2],
                             episodename=None,
                             filename=None)

    assertEquals(ep.generateFilename(), 'Scrubs - [02]')
Пример #3
0
def test_no_series_number():
    """Episode without season number
    """
    ep = NoSeasonEpisodeInfo(
        seriesname = 'Scrubs',
        episodenumbers = [2],
        episodename = 'My Mentor',
        filename = None)

    assertEquals(
        ep.generateFilename(),
        'Scrubs - [02] - My Mentor')
Пример #4
0
def test_noseason_no_name_no_ext():
    """NoSeasonEpisodeInfo with no name or extension
    """
    ep = NoSeasonEpisodeInfo(
        seriesname = 'Scrubs',
        episodenumbers = [2],
        episodename = None,
        filename = None)

    assertEquals(
        ep.generateFilename(),
        'Scrubs - [02]')
Пример #5
0
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'])

    ep.populateFromTvdb(tvdb_instance)

    assert ep.seriesname is not None, "Corrected series name was none"
    assert ep.episodename is not None, "Episode name was None"

    assertEquals(ep.seriesname, curtest['correctedseriesname'])
    assertEquals(ep.episodename, curtest['episodenames'])