Example #1
0
    def test_update_tracker(self):
        db_tracker, updated = PDbManager.update(self.trackers[0])
        self.assertIsInstance(db_tracker, PTracker)
        self.assertFalse(updated)

        self.trackers[0]._path = '/path/updated'
        db_tracker, updated = PDbManager.update(self.trackers[0])
        self.assertIsInstance(db_tracker, PTracker)
        self.assertTrue(updated)
Example #2
0
    def test_update_torrent(self):
        db_torrent, updated = PDbManager.update(self.torrents[0])
        self.assertIsInstance(db_torrent, PTorrent)
        self.assertFalse(updated)

        self.torrents[0].name = "name_1"
        db_torrent, updated = PDbManager.update(self.torrents[0])
        self.assertIsInstance(db_torrent, PTorrent)
        self.assertTrue(updated)
Example #3
0
    def test_update_movie(self):
        with self.assertRaises(ValueError):
            db_movie, updated = PDbManager.update(self.movies[0])

        db_imdb_obj, torrents_updated = PDbManager.movie_to_db(self.movies[0], update=True)
        self.assertIsInstance(db_imdb_obj, PIMDBObject)