def test_issue21(self): with copyTestFile('readönly.mp3') as copy_file: os.chmod(copy_file, stat.S_IREAD) tfile = taglib.File(copy_file.encode('utf8')) tfile.tags['COMMENT'] = [''] self.assertRaises(OSError, tfile.save) tfile.close()
def test_delete_key(self): with copyTestFile('issue19.flac') as copy_file: tfile = taglib.File(copy_file) del tfile.tags['COMMENT'] tfile.save() tfile.close() tfile = taglib.File(copy_file) self.assertNotIn('COMMENT', tfile.tags) tfile.close()
def test_set_to_empty_list(self): with copyTestFile('issue19.flac') as copy_file: tfile = taglib.File(copy_file) tfile.tags['COMMENT'] = [] tfile.save() tfile.close() tfile = taglib.File(copy_file) self.assertNotIn('COMMENT', tfile.tags) tfile.close()
def test_set_to_space(self): with copyTestFile('issue19.flac') as copy_file: tfile = taglib.File(copy_file) tfile.tags['COMMENT'] = [' '] tfile.save() tfile.close() tfile = taglib.File(copy_file) self.assertIn('COMMENT', tfile.tags) self.assertEqual(tfile.tags['COMMENT'][0], ' ') tfile.close()
def test_issue46(self): with copyTestFile('issue46.m4a') as copy_file: tfile = taglib.File(copy_file) self.assertIn('ALBUMARTIST', tfile.tags) self.assertEquals(['Higginbottom, Edward'], tfile.tags['ALBUMARTIST']) tfile.close()
def test_issue28(self): with copyTestFile('Жбж.mp3') as copy_file: tfile = taglib.File(copy_file) tfile.tags['COMMENT'] = ['test'] tfile.save() tfile.close()