def test_create_new_show(self):
     show = mediamodel.TvShow("my show")
     self.assertIsNotNone(show)
 def setUp(self):
     self.show = mediamodel.TvShow("my show")
 def setUp(self):
     self.show = mediamodel.TvShow("my show")
     self.show.add_episode("Into the North", 1, 1)
 def test_show_name_accessible(self):
     show = mediamodel.TvShow("my show")
     self.assertEqual(show.name, 'Mr. Robot')
 def test_shouldnt_assign_name(self):
     show = mediamodel.TvShow("my show")
     with self.assertRaises(AttributeError):
         show.name = 'Dr. Who'
示例#6
0
 def setUp(self):
     self.show = mediamodel.TvShow('Game of Thrones')
     self.show.add_episode("Into the North", 1, 1)
示例#7
0
 def test_create_new_show(self):
     show = mediamodel.TvShow('Mr. Robot')
     self.assertIsNotNone(show)
示例#8
0
 def setUp(self):
     self.show = mediamodel.TvShow('Game of Thrones')
def test_create_empty_tvshow():
    my_show = media.TvShow("my show")
    assert my_show.name == "My show"
    assert len(my_show.get_episodes()) == 0
    assert len(my_show.episodes) == 0
def show_with_few_episodes_same_season():
    my_show = media.TvShow("My Show")
    my_show.add_episode("First", 1, 1)
    my_show.add_episode("Second", 2, 1)
    my_show.add_episode("Fifth", 5, 1)
def empty_show():
    return media.TvShow("My Show")
示例#12
0
    try:
        _tvshow.add_episode(ep_title, ep_number, ep_season)
    except ValueError:
        print("L'épisode {} de la saison {} existe déjà".format(
            ep_number, ep_season))


actions = {}
actions['a'] = add_episode
actions['s'] = saisons_list
actions['e'] = episodes_list

if __name__ == "__main__":
    print("Gestion de série")
    tvshow_name = input("Entrez le titre de la série ")
    _tvshow = mediamodel.TvShow(tvshow_name)

    while True:
        print("""
        [a] ajouter un épisode
        [s] lister les saisons
        [e] lister les épisodes
        [q] sortie
        """)

        choice = input("Choix ? ")
        if choice in actions:
            actions[choice]()
        elif choice == "q":
            break
        else: