Exemple #1
0
def test_database_add_episode_progress(prevent_modification):
    copyfile(my_dir + "/datafiles/database_example1.db", Database.PATH)
    mydatabase = Database()
    ep = mydatabase.episode(1)
    mydatabase.replace_progress(ep, 1000)
    ep_db = mydatabase.episode(1)
    assert ep_db.progress == 1000
    assert ep.progress == 1000
Exemple #2
0
def test_database_delete_feed_episode_and_progress(prevent_modification):
    copyfile(my_dir + "/datafiles/database_example1.db", Database.PATH)
    mydatabase = Database()

    feed = mydatabase.feeds()[0]
    feed_episode = mydatabase.episodes(feed)[0]
    mydatabase.replace_progress(feed_episode, 1000)

    feed_episode = mydatabase.episodes(feed)[0]
    assert feed_episode.progress == 1000
    mydatabase.replace_progress(feed_episode, 1000)
    mydatabase.delete_feed(feed)
    # returns None since nothing was deleted
    assert mydatabase.delete_progress(feed_episode) is None