def __save_tags(self, tags, expected): #return song = OggFile(self.filename) for key, value in tags.iteritems(): song[key] = value song.write() m = OggVorbis(self.filename) # test if all values ended up where we wanted for key, value in expected.iteritems(): self.failUnless(key in m.tags) self.failUnlessEqual(m.tags[key], [value]) # test if not specified are not there if self.MAIN not in expected: self.failIf(self.MAIN in m.tags) if self.FALLBACK not in expected: self.failIf(self.FALLBACK in m.tags) if self.SINGLE not in expected: self.failIf(self.SINGLE in m.tags)
def __save_tags(self, tags, expected): #return song = OggFile(self.filename) for key, value in iteritems(tags): song[key] = value song.write() m = OggVorbis(self.filename) # test if all values ended up where we wanted for key, value in iteritems(expected): self.failUnless(key in m.tags) self.failUnlessEqual(m.tags[key], [value]) # test if not specified are not there if self.MAIN not in expected: self.failIf(self.MAIN in m.tags) if self.FALLBACK not in expected: self.failIf(self.FALLBACK in m.tags) if self.SINGLE not in expected: self.failIf(self.SINGLE in m.tags)
def __load_tags(self, tags, expected): m = OggVorbis(self.filename) for key, value in iteritems(tags): m.tags[key] = value m.save() song = OggFile(self.filename) for key, value in iteritems(expected): self.failUnlessEqual(song(key), value) if self.MAIN not in expected: self.failIf(self.MAIN in song) if self.SINGLE not in expected: self.failIf(self.SINGLE in song) if self.FALLBACK not in expected: self.failIf(self.FALLBACK in song)
def setUp(self): TVCFile.setUp(self) self.filename = get_temp_copy(os.path.join(DATA_DIR, 'empty.ogg')) self.song = OggFile(self.filename)
def setUp(self): TVCFile.setUp(self) h, self.filename = mkstemp(".ogg") os.close(h) shutil.copy(os.path.join(DATA_DIR, 'empty.ogg'), self.filename) self.song = OggFile(self.filename)
def setUp(self): TVCFile.setUp(self) self.filename = get_temp_copy(get_data_path('empty.ogg')) self.song = OggFile(self.filename)