def test_read(self): s = EncodedTextSpec('name') f = Frame() f.encoding = 0 header = ID3Header() header.version = (2, 4, 0) self.assertEquals((u'abcd', b'fg'), s.read(header, f, b'abcd\x00fg'))
def test_write(self): s = EncodedTextSpec('name') f = Frame() f.encoding = 0 self.assertEquals(b'abcdefg\x00', s.write(None, f, u'abcdefg')) self.assertRaises(AttributeError, s.write, None, f, None)
def test_read(self): s = EncodedTextSpec('name') f = Frame() f.encoding = 0 self.assertEquals((u'abcd', b'fg'), s.read(None, f, b'abcd\x00fg'))