def test_unsupported(self): extended_attribute = parse_extended_attribute(bytes.fromhex('43 00')) self.assertIsInstance(extended_attribute, ExtendedAttribute) self.assertEqual(extended_attribute.type_, 0x43) self.assertEqual(extended_attribute.value, 0x00)
def test_invalid(self): with self.assertRaises(Exception): parse_extended_attribute(bytes.fromhex('00'))
def test_foreground_color(self): extended_attribute = parse_extended_attribute(bytes.fromhex('42 00')) self.assertIsInstance(extended_attribute, ForegroundColorExtendedAttribute)
def test_highlight(self): extended_attribute = parse_extended_attribute(bytes.fromhex('41 f2')) self.assertIsInstance(extended_attribute, HighlightExtendedAttribute)