コード例 #1
0
    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)
コード例 #2
0
 def test_invalid(self):
     with self.assertRaises(Exception):
         parse_extended_attribute(bytes.fromhex('00'))
コード例 #3
0
    def test_foreground_color(self):
        extended_attribute = parse_extended_attribute(bytes.fromhex('42 00'))

        self.assertIsInstance(extended_attribute,
                              ForegroundColorExtendedAttribute)
コード例 #4
0
    def test_highlight(self):
        extended_attribute = parse_extended_attribute(bytes.fromhex('41 f2'))

        self.assertIsInstance(extended_attribute, HighlightExtendedAttribute)