Пример #1
0
    def test_special_season_shouldnot_became_last_season(self):
        season1 = LostFilmSeason(SpecialSeasons.Additional)

        show = LostFilmShow('Show', u'Шоу', 'Show', 2017)

        assert show.last_season is None
        assert show.seasons_url == 'https://www.lostfilm.tv/series/Show/seasons'

        show.add_season(season1)

        assert show.last_season is None

        assert len(show) == 1

        assert show[SpecialSeasons.Additional] == season1

        assert list(show) == [season1]
        assert list(reversed(show)) == [season1]
Пример #2
0
    def test_add_season_success(self):
        season1 = LostFilmSeason(1)
        season2 = LostFilmSeason(2)

        show = LostFilmShow('Show', u'Шоу', 'Show', 2017)

        assert show.last_season is None
        assert show.seasons_url == 'https://www.lostfilm.tv/series/Show/seasons'

        show.add_season(season1)
        show.add_season(season2)

        assert len(show) == 2

        assert show[1] == season1
        assert show[2] == season2
        assert show.last_season == season2

        assert list(show) == [season1, season2]
        assert list(reversed(show)) == [season2, season1]
Пример #3
0
    def test_add_episode_failed(self):
        season1 = LostFilmSeason(2)

        show = LostFilmShow('Show', u'Шоу', 'Show', 2017)

        assert show.seasons_url == 'https://www.lostfilm.tv/series/Show/seasons'

        show.add_season(season1)
        with pytest.raises(Exception) as e:
            show.add_season(season1)
        message = six.text_type(e.value)
        assert six.text_type(season1.number) in message
        assert 'already' in message

        assert len(show) == 1

        assert show[2] == season1
        assert show.last_season == season1

        assert list(show) == [season1]
        assert list(reversed(show)) == [season1]