Ejemplo n.º 1
0
 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()
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
    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()
Ejemplo n.º 4
0
    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()
Ejemplo n.º 5
0
    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()
Ejemplo n.º 6
0
    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()
Ejemplo n.º 7
0
    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()
Ejemplo n.º 8
0
    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()
Ejemplo n.º 9
0
 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()
Ejemplo n.º 10
0
 def test_issue28(self):
     with copyTestFile('Жбж.mp3') as copy_file:
         tfile = taglib.File(copy_file)
         tfile.tags['COMMENT'] = ['test']
         tfile.save()
         tfile.close()