示例#1
0
 def test_check_updates(self):
    # load an empty cache
     zelfratz.conf = zelfratz.configuration(None, zelfratz.zdata(), None)
     # this will invoke the OVERRIDE and add stuff in xml to cache
     zelfratz.check_updates_artists([self.pyro])
     zelfratz.check_updates_labels([self.digital_venom])
     # now comapare the cache to one thats on disk
     target = zelfratz.read_cache('test_cache')
     result = zelfratz.conf.cache
     self.assertEqual(target, result, msg="test_check_updates failed")
示例#2
0
 def test_difference(self):
     # load apparently old artist info into cache
     zelfratz.conf = zelfratz.configuration(None, zelfratz.zdata(), None)
     rel = load_xml_from_file('old_releases_by_artist.xml')
     zelfratz.conf.cache.update_artist(self.pyro, rel)
     # load apparently old label info into cache
     rel = load_xml_from_file('old_releases_by_label.xml')
     zelfratz.conf.cache.update_label(self.digital_venom, rel)
     # now run the update methods and see what the return
     result = zelfratz.check_updates_artists([self.pyro])
     target = unpickle('pickled_artist_updates')
     self.assertEqual(target, result, msg="test_difference failed for artists")
     result = zelfratz.check_updates_labels([self.digital_venom])
     target = unpickle('pickled_label_updates')
     self.assertEqual(target, result, msg="test_difference failed for labels")