Lines Matching refs:Bytes
33 class Bytes(bytearray): class
39 s = Bytes._parse_compact(s)
42 s = Bytes._parse_octets(s)
44 s = Bytes._parse_hextets(s)
114 return Bytes(x)
124 elif not isinstance(other, Bytes):
134 x = Bytes(b"\x01\x02\x03\x04")
142 assert Bytes._parse_compact("") == Bytes(b"")
143 assert Bytes._parse_compact('01020304') == x
145 assert Bytes._parse_octets("") == Bytes(b"")
146 assert Bytes._parse_octets('01:02:03:04') == x
148 assert Bytes._parse_hextets("") == Bytes(b"")
149 assert Bytes._parse_hextets('0102:0304') == x
151 assert isinstance(x[:2], Bytes)
152 assert isinstance(x[-2:], Bytes)
153 assert x[:2] == Bytes(b'\x01\x02')
154 assert x[-2:] == Bytes(b'\x03\x04')
157 assert Bytes("01020304") == Bytes(b"\x01\x02\x03\x04")
158 assert Bytes("01:02:03:04") == Bytes(b"\x01\x02\x03\x04")
159 assert Bytes("0102:0304") == Bytes(b"\x01\x02\x03\x04")