Lines Matching refs:assertEqual
51 self.assertEqual(type(b), self.type2test)
52 self.assertEqual(b.__class__, self.type2test)
58 self.assertEqual(a, b)
59 self.assertEqual(type(a), type(b))
63 self.assertEqual(len(b), 0)
78 self.assertEqual(len(b), 256)
79 self.assertEqual(list(b), list(range(256)))
83 self.assertEqual(b, b"*")
89 self.assertEqual(len(b), 256)
90 self.assertEqual(list(b), list(range(256)))
94 self.assertEqual(len(b), 128)
95 self.assertEqual(list(b), list(range(256))[1::2])
102 self.assertEqual(b, b"\x01\x02\x03")
107 self.assertEqual(len(b), 256)
108 self.assertEqual(list(b), list(range(256)))
110 self.assertEqual(b, b"\x01\x02\x03")
115 self.assertEqual(len(b), 256)
116 self.assertEqual(list(b), list(range(256)))
118 self.assertEqual(b, b"\x01\x02\x03")
127 self.assertEqual(bytes(a), b'*')
135 self.assertEqual(bytes(a), b'*' * 1000) # should not crash
140 self.assertEqual(list(b), [0, 1, 254, 255])
146 self.assertEqual(a, b"\x01\x02\x03")
148 self.assertEqual(a, b"\x01\x02\x03")
156 self.assertEqual(self.type2test(B(b"foobar")), b"foobar")
159 self.assertEqual(self.type2test(0), b'')
160 self.assertEqual(self.type2test(1), b'\x00')
161 self.assertEqual(self.type2test(5), b'\x00\x00\x00\x00\x00')
164 self.assertEqual(self.type2test('0', 'ascii'), b'0')
165 self.assertEqual(self.type2test(b'0'), b'0')
229 self.assertEqual(b1, b2)
252 self.assertEqual(self.type2test(b"\0a\0b\0c") == "abc", False)
253 self.assertEqual(self.type2test(b"\0\0\0a\0\0\0b\0\0\0c") == "abc",
255 self.assertEqual(self.type2test(b"a\0b\0c\0") == "abc", False)
256 self.assertEqual(self.type2test(b"a\0\0\0b\0\0\0c\0\0\0") == "abc",
258 self.assertEqual(self.type2test() == str(), False)
259 self.assertEqual(self.type2test() != str(), True)
266 self.assertEqual(output, input)
273 self.assertEqual(b[:5], by("Hello"))
274 self.assertEqual(b[1:5], by("ello"))
275 self.assertEqual(b[5:7], by(", "))
276 self.assertEqual(b[7:], by("world"))
277 self.assertEqual(b[7:12], by("world"))
278 self.assertEqual(b[7:100], by("world"))
280 self.assertEqual(b[:-7], by("Hello"))
281 self.assertEqual(b[-11:-7], by("ello"))
282 self.assertEqual(b[-7:-5], by(", "))
283 self.assertEqual(b[-5:], by("world"))
284 self.assertEqual(b[-5:12], by("world"))
285 self.assertEqual(b[-5:100], by("world"))
286 self.assertEqual(b[-100:5], by("Hello"))
297 self.assertEqual(b[start:stop:step], self.type2test(L[start:stop:step]))
303 self.assertEqual(b, self.type2test(sample.encode(enc)))
306 self.assertEqual(b, self.type2test(sample[:-3], "utf-8"))
312 self.assertEqual(b.decode(enc), sample)
316 self.assertEqual(b.decode("utf-8", "ignore"), "Hello world\n")
317 self.assertEqual(b.decode(errors="ignore", encoding="utf-8"),
320 self.assertEqual(self.type2test(b'\xe2\x98\x83').decode(), '\u2603')
376 self.assertEqual(proc.rc, 10, proc)
380 self.assertEqual(b, self.type2test())
382 self.assertEqual(b, self.type2test([0]*10))
384 self.assertEqual(b, self.type2test([0]*10000))
389 self.assertEqual(b1 + b2, b"abcdef")
390 self.assertEqual(b1 + bytes(b"def"), b"abcdef")
391 self.assertEqual(bytes(b"def") + b1, b"defabc")
397 self.assertEqual(b * 3, b"abcabcabc")
398 self.assertEqual(b * 0, b"")
399 self.assertEqual(b * -1, b"")
409 self.assertEqual(self.type2test(b'x')*100, self.type2test([ord('x')]*100))
438 self.assertEqual(self.type2test.fromhex(''), self.type2test())
440 self.assertEqual(self.type2test.fromhex('1a2B30'), b)
441 self.assertEqual(self.type2test.fromhex(' 1A 2B 30 '), b)
444 self.assertEqual(self.type2test.fromhex(' 1A\n2B\t30\v'), b)
446 self.assertEqual(self.type2test.fromhex(c), self.type2test())
450 self.assertEqual(self.type2test.fromhex('0000'), b'\0\0')
475 self.assertEqual(self.type2test(b"").hex(), "")
476 self.assertEqual(bytearray([0x1a, 0x2b, 0x30]).hex(), '1a2b30')
477 self.assertEqual(self.type2test(b"\x1a\x2b\x30").hex(), '1a2b30')
478 self.assertEqual(memoryview(b"\x1a\x2b\x30").hex(), '1a2b30')
482 self.assertEqual(three_bytes.hex(), 'b901ef')
487 self.assertEqual(three_bytes.hex(':', 0), 'b901ef')
498 self.assertEqual(three_bytes.hex(':', 0), 'b901ef')
499 self.assertEqual(three_bytes.hex(b'\x00'), 'b9\x0001\x00ef')
500 self.assertEqual(three_bytes.hex('\x00'), 'b9\x0001\x00ef')
501 self.assertEqual(three_bytes.hex(b'\x7f'), 'b9\x7f01\x7fef')
502 self.assertEqual(three_bytes.hex('\x7f'), 'b9\x7f01\x7fef')
503 self.assertEqual(three_bytes.hex(':', 3), 'b901ef')
504 self.assertEqual(three_bytes.hex(':', 4), 'b901ef')
505 self.assertEqual(three_bytes.hex(':', -4), 'b901ef')
506 self.assertEqual(three_bytes.hex(':'), 'b9:01:ef')
507 self.assertEqual(three_bytes.hex(b'$'), 'b9$01$ef')
508 self.assertEqual(three_bytes.hex(':', 1), 'b9:01:ef')
509 self.assertEqual(three_bytes.hex(':', -1), 'b9:01:ef')
510 self.assertEqual(three_bytes.hex(':', 2), 'b9:01ef')
511 self.assertEqual(three_bytes.hex(':', 1), 'b9:01:ef')
512 self.assertEqual(three_bytes.hex('*', -2), 'b901*ef')
515 …self.assertEqual(value.hex('.', 8), '7b7305000000776f.726c646902000000.730500000068656c.6c6f690100…
519 self.assertEqual(five_bytes.hex(), '5a5b5c5d5e')
523 self.assertEqual(six_bytes.hex(), '0306090c0f12')
524 self.assertEqual(six_bytes.hex('.', 1), '03.06.09.0c.0f.12')
525 self.assertEqual(six_bytes.hex(' ', 2), '0306 090c 0f12')
526 self.assertEqual(six_bytes.hex('-', 3), '030609-0c0f12')
527 self.assertEqual(six_bytes.hex(':', 4), '0306:090c0f12')
528 self.assertEqual(six_bytes.hex(':', 5), '03:06090c0f12')
529 self.assertEqual(six_bytes.hex(':', 6), '0306090c0f12')
530 self.assertEqual(six_bytes.hex(':', 95), '0306090c0f12')
531 self.assertEqual(six_bytes.hex('_', -3), '030609_0c0f12')
532 self.assertEqual(six_bytes.hex(':', -4), '0306090c:0f12')
533 self.assertEqual(six_bytes.hex(b'@', -5), '0306090c0f@12')
534 self.assertEqual(six_bytes.hex(':', -6), '0306090c0f12')
535 self.assertEqual(six_bytes.hex(' ', -95), '0306090c0f12')
538 self.assertEqual(self.type2test(b"").join([]), b"")
539 self.assertEqual(self.type2test(b"").join([b""]), b"")
542 self.assertEqual(self.type2test(b"").join(lst), b"abc")
543 self.assertEqual(self.type2test(b"").join(tuple(lst)), b"abc")
544 self.assertEqual(self.type2test(b"").join(iter(lst)), b"abc")
546 self.assertEqual(dot_join([b"ab", b"cd"]), b"ab.:cd")
547 self.assertEqual(dot_join([memoryview(b"ab"), b"cd"]), b"ab.:cd")
548 self.assertEqual(dot_join([b"ab", memoryview(b"cd")]), b"ab.:cd")
549 self.assertEqual(dot_join([bytearray(b"ab"), b"cd"]), b"ab.:cd")
550 self.assertEqual(dot_join([b"ab", bytearray(b"cd")]), b"ab.:cd")
554 self.assertEqual(dot_join(seq), expected)
558 self.assertEqual(self.type2test(b"").join(seq), expected)
573 self.assertEqual(b.count(b'i'), 4)
574 self.assertEqual(b.count(b'ss'), 2)
575 self.assertEqual(b.count(b'w'), 0)
577 self.assertEqual(b.count(i), 4)
578 self.assertEqual(b.count(w), 0)
580 self.assertEqual(b.count(b'i', 6), 2)
581 self.assertEqual(b.count(b'p', 6), 2)
582 self.assertEqual(b.count(b'i', 1, 3), 1)
583 self.assertEqual(b.count(b'p', 7, 9), 1)
585 self.assertEqual(b.count(i, 6), 2)
586 self.assertEqual(b.count(p, 6), 2)
587 self.assertEqual(b.count(i, 1, 3), 1)
588 self.assertEqual(b.count(p, 7, 9), 1)
623 self.assertEqual(b.find(b'ss'), 2)
624 self.assertEqual(b.find(b'w'), -1)
625 self.assertEqual(b.find(b'mississippian'), -1)
627 self.assertEqual(b.find(i), 1)
628 self.assertEqual(b.find(w), -1)
630 self.assertEqual(b.find(b'ss', 3), 5)
631 self.assertEqual(b.find(b'ss', 1, 7), 2)
632 self.assertEqual(b.find(b'ss', 1, 3), -1)
634 self.assertEqual(b.find(i, 6), 7)
635 self.assertEqual(b.find(i, 1, 3), 1)
636 self.assertEqual(b.find(w, 1, 3), -1)
648 self.assertEqual(b.rfind(b'ss'), 5)
649 self.assertEqual(b.rfind(b'w'), -1)
650 self.assertEqual(b.rfind(b'mississippian'), -1)
652 self.assertEqual(b.rfind(i), 10)
653 self.assertEqual(b.rfind(w), -1)
655 self.assertEqual(b.rfind(b'ss', 3), 5)
656 self.assertEqual(b.rfind(b'ss', 0, 6), 2)
658 self.assertEqual(b.rfind(i, 1, 3), 1)
659 self.assertEqual(b.rfind(i, 3, 9), 7)
660 self.assertEqual(b.rfind(w, 1, 3), -1)
667 self.assertEqual(b.index(b'ss'), 2)
671 self.assertEqual(b.index(i), 1)
674 self.assertEqual(b.index(b'ss', 3), 5)
675 self.assertEqual(b.index(b'ss', 1, 7), 2)
678 self.assertEqual(b.index(i, 6), 7)
679 self.assertEqual(b.index(i, 1, 3), 1)
687 self.assertEqual(b.rindex(b'ss'), 5)
691 self.assertEqual(b.rindex(i), 10)
694 self.assertEqual(b.rindex(b'ss', 3), 5)
695 self.assertEqual(b.rindex(b'ss', 0, 6), 2)
697 self.assertEqual(b.rindex(i, 1, 3), 1)
698 self.assertEqual(b.rindex(i, 3, 9), 7)
705 self.assertEqual(b, b'hello, world!')
706 self.assertEqual(orig, b'hello, %b!')
710 self.assertEqual(a, b'seventy-nine / 100 = 79%')
715 self.assertEqual(b, b'hello,\x00world!')
722 self.assertEqual(b, b'hello, world!')
723 self.assertEqual(orig, b'hello, %b!')
727 self.assertEqual(b, b'seventy-nine / 100 = 79%')
732 self.assertEqual(b, b'hello,\x00world!')
742 self.assertEqual(b.replace(b'i', b'a'), b'massassappa')
743 self.assertEqual(b.replace(b'ss', b'x'), b'mixixippi')
759 self.assertEqual(b.split(), [b])
761 self.assertEqual(b.split(), [b'\x1c\x1d\x1e\x1f'])
765 self.assertEqual(b.rsplit(), [b'\x1c\x1d\x1e\x1f'])
769 self.assertEqual(b.partition(b'ss'), (b'mi', b'ss', b'issippi'))
770 self.assertEqual(b.partition(b'w'), (b'mississippi', b'', b''))
774 self.assertEqual(b.rpartition(b'ss'), (b'missi', b'ss', b'ippi'))
775 self.assertEqual(b.rpartition(b'i'), (b'mississipp', b'i', b''))
776 self.assertEqual(b.rpartition(b'w'), (b'', b'', b'mississippi'))
792 self.assertEqual(b, q)
801 self.assertEqual(type(itorg), type(it))
802 self.assertEqual(list(it), data)
810 self.assertEqual(list(it), data[1:])
813 self.assertEqual(self.type2test(b'abc').strip(memoryview(b'ac')), b'b')
814 self.assertEqual(self.type2test(b'abc').lstrip(memoryview(b'ac')), b'bc')
815 self.assertEqual(self.type2test(b'abc').rstrip(memoryview(b'ac')), b'ab')
831 self.assertEqual(b.center(7, fill_type(b'-')),
838 self.assertEqual(b.ljust(7, fill_type(b'-')),
845 self.assertEqual(b.rjust(7, fill_type(b'-')),
855 self.assertEqual([ord(b[i:i+1]) for i in range(len(b))],
860 self.assertEqual(self.type2test.maketrans(b'abc', b'xyz'), transtable)
862 self.assertEqual(self.type2test.maketrans(b'\375\376\377', b'xyz'), transtable)
874 self.assertEqual(2, b.find(l, None))
875 self.assertEqual(3, b.find(l, -2, None))
876 self.assertEqual(2, b.find(l, None, -2))
877 self.assertEqual(0, b.find(h, None, None))
879 self.assertEqual(3, b.rfind(l, None))
880 self.assertEqual(3, b.rfind(l, -2, None))
881 self.assertEqual(2, b.rfind(l, None, -2))
882 self.assertEqual(0, b.rfind(h, None, None))
884 self.assertEqual(2, b.index(l, None))
885 self.assertEqual(3, b.index(l, -2, None))
886 self.assertEqual(2, b.index(l, None, -2))
887 self.assertEqual(0, b.index(h, None, None))
889 self.assertEqual(3, b.rindex(l, None))
890 self.assertEqual(3, b.rindex(l, -2, None))
891 self.assertEqual(2, b.rindex(l, None, -2))
892 self.assertEqual(0, b.rindex(h, None, None))
894 self.assertEqual(2, b.count(l, None))
895 self.assertEqual(1, b.count(l, -2, None))
896 self.assertEqual(1, b.count(l, None, -2))
897 self.assertEqual(0, b.count(x, None, None))
899 self.assertEqual(True, b.endswith(o, None))
900 self.assertEqual(True, b.endswith(o, -2, None))
901 self.assertEqual(True, b.endswith(l, None, -2))
902 self.assertEqual(False, b.endswith(x, None, None))
904 self.assertEqual(True, b.startswith(h, None))
905 self.assertEqual(True, b.startswith(l, -2, None))
906 self.assertEqual(True, b.startswith(h, None, -2))
907 self.assertEqual(False, b.startswith(x, None, None))
950 self.assertEqual(b, b'hello')
955 self.assertEqual(c, d)
956 self.assertEqual(c, b'helle')
959 self.assertEqual(c, b'hee')
961 self.assertEqual(c, b'hllo')
965 self.assertEqual(c, b'helle')
967 self.assertEqual(c, b'hee')
969 self.assertEqual(c, b'hllo')
978 self.assertEqual(_testcapi.sequence_getitem(obj, 0), 42)
999 self.assertEqual(bytes(A()), b'abc')
1011 self.assertEqual(bytes(A()), b'a')
1016 self.assertEqual(bytes(A('\u20ac')), b'abc')
1017 self.assertEqual(bytes(A('\u20ac'), 'iso8859-15'), b'\xa4')
1022 self.assertEqual(bytes(A()), b'abc')
1024 self.assertEqual(BytesSubclass(A()), b'abc')
1043 self.assertEqual(PyBytes_FromFormat(b'format'),
1045 self.assertEqual(PyBytes_FromFormat(b'Hello %s !', b'world'),
1049 self.assertEqual(PyBytes_FromFormat(b'c=%c', c_int(0)),
1051 self.assertEqual(PyBytes_FromFormat(b'c=%c', c_int(ord('@'))),
1053 self.assertEqual(PyBytes_FromFormat(b'c=%c', c_int(255)),
1055 self.assertEqual(PyBytes_FromFormat(b'd=%d ld=%ld zd=%zd',
1059 self.assertEqual(PyBytes_FromFormat(b'd=%d ld=%ld zd=%zd',
1063 self.assertEqual(PyBytes_FromFormat(b'u=%u lu=%lu zu=%zu',
1067 self.assertEqual(PyBytes_FromFormat(b'i=%i', c_int(123)),
1069 self.assertEqual(PyBytes_FromFormat(b'i=%i', c_int(-123)),
1071 self.assertEqual(PyBytes_FromFormat(b'x=%x', c_int(0xabc)),
1087 self.assertEqual(PyBytes_FromFormat(b'ptr=%p', c_char_p(ptr)),
1089 self.assertEqual(PyBytes_FromFormat(b's=%s', c_char_p(b'cstr')),
1105 self.assertEqual(PyBytes_FromFormat(formatstr, ctypes_type(value)),
1109 self.assertEqual(PyBytes_FromFormat(b'%5s', b'a'),
1111 self.assertEqual(PyBytes_FromFormat(b'%.3s', b'abcdef'),
1115 self.assertEqual(PyBytes_FromFormat(b'%%'),
1117 self.assertEqual(PyBytes_FromFormat(b'[%%]'),
1119 self.assertEqual(PyBytes_FromFormat(b'%%%c', c_int(ord('_'))),
1121 self.assertEqual(PyBytes_FromFormat(b'%%s'),
1125 self.assertEqual(PyBytes_FromFormat(b'%'), b'%')
1126 self.assertEqual(PyBytes_FromFormat(b'x=%i y=%', c_int(2), c_int(3)),
1137 self.assertEqual(PyBytes_FromFormat(b''),
1139 self.assertEqual(PyBytes_FromFormat(b'%s', b''),
1146 self.assertEqual(bytes(i), b'\x00\x01\x02\x03')
1154 self.assertEqual(bytes(3), b'\0\0\0')
1163 self.assertEqual(bytes(b'ab'), b'ab')
1169 self.assertEqual(bytes(ba), b'ab')
1175 self.assertEqual(id(a), id(a))
1179 self.assertEqual(id(a), id(a * 1))
1180 self.assertEqual(id(a), id(1 * a))
1187 self.assertEqual(id(s), id(s))
1225 self.assertEqual(n, len(short_sample))
1226 self.assertEqual(list(b), list(sample))
1231 self.assertEqual(f.read(), sample)
1241 self.assertEqual(b.reverse(), None)
1242 self.assertEqual(b, b'olleh')
1245 self.assertEqual(b, b'1olleh')
1253 self.assertEqual(b, b'')
1257 self.assertEqual(b, b'')
1263 self.assertEqual(b, b'p')
1268 self.assertEqual(bb, b'abc')
1272 self.assertEqual(bb, b'')
1277 self.assertEqual(b, bb)
1280 self.assertEqual(bb, b'abcd')
1281 self.assertEqual(b, b'abc')
1287 self.assertEqual(re.findall(br"\w+", b), [by("Hello"), by("world")])
1292 self.assertEqual(b, bytearray([1, 100, 3]))
1294 self.assertEqual(b, bytearray([1, 100, 200]))
1296 self.assertEqual(b, bytearray([10, 100, 200]))
1326 self.assertEqual(b, bytearray(range(1, 10)))
1328 self.assertEqual(b, bytearray(range(1, 9)))
1330 self.assertEqual(b, bytearray([1, 2, 3, 4, 6, 7, 8]))
1334 self.assertEqual(list(b), list(range(10)))
1337 self.assertEqual(b, bytearray([1, 1, 1, 1, 1, 5, 6, 7, 8, 9]))
1340 self.assertEqual(b, bytearray([5, 6, 7, 8, 9]))
1343 self.assertEqual(b, bytearray(range(10)))
1346 self.assertEqual(b, bytearray([0, 1, 2, 100, 101, 7, 8, 9]))
1349 self.assertEqual(b, bytearray(range(10)))
1352 self.assertEqual(b, bytearray([0, 1, 2, 42, 42, 42, 3, 4, 5, 6, 7, 8, 9]))
1355 self.assertEqual(b, bytearray([0, 1, 2, 102, 111, 111]))
1358 self.assertEqual(b, bytearray([102, 111, 111, 102, 111, 111]))
1361 self.assertEqual(b, bytearray([102, 111, 111, 111, 111]))
1375 self.assertEqual(list(b), list(range(100)))
1377 self.assertEqual(list(b), list(range(10, 100)))
1379 self.assertEqual(list(b), list(range(10, 110)))
1412 self.assertEqual(b, bytearray(L))
1416 self.assertEqual(b, bytearray(L))
1423 self.assertEqual(b, bytearray(list(range(8)) + list(range(256))))
1429 self.assertEqual(b, b"abcdef")
1430 self.assertEqual(b, b1)
1433 self.assertEqual(b, b"abcdefxyz")
1445 self.assertEqual(b, b"abcabcabc")
1446 self.assertEqual(b, b1)
1453 self.assertEqual(b, b"x"*100)
1454 self.assertEqual(b, b1)
1475 self.assertEqual(a, list(range(1, len(a)+1)))
1476 self.assertEqual(len(b), len(a))
1481 self.assertEqual(list(b), list(range(1, 100)))
1482 self.assertEqual(len(b), 99)
1490 self.assertEqual(a, orig + orig)
1491 self.assertEqual(a[5:], orig)
1496 self.assertEqual(a, orig * 50)
1497 self.assertEqual(a[-5:], orig)
1500 self.assertEqual(a, orig * 50)
1501 self.assertEqual(a[-5:], orig)
1504 self.assertEqual(a, orig * 50)
1505 self.assertEqual(a[-5:], orig)
1509 self.assertEqual(len(a), 0)
1512 self.assertEqual(a, b'a')
1517 self.assertEqual(b, b'helo')
1519 self.assertEqual(b, b'heo')
1526 self.assertEqual(b, b'e')
1529 self.assertEqual(b, b'')
1534 self.assertEqual(c, bytes([126, 128, 129]))
1536 self.assertEqual(c, bytes([126, 128]))
1540 self.assertEqual(b.pop(), ord('d'))
1541 self.assertEqual(b.pop(0), ord('w'))
1542 self.assertEqual(b.pop(-2), ord('r'))
1546 self.assertEqual(bytearray(b'\xff').pop(), 0xff)
1554 self.assertEqual(b, b'hello')
1555 self.assertEqual(b.append(100), None)
1558 self.assertEqual(len(b), 1)
1562 self.assertEqual(b, b'A')
1570 self.assertEqual(b, b'mississippi')
1574 self.assertEqual(b, b'A')
1588 self.assertEqual(b, b"")
1589 self.assertEqual(c, b"")
1592 self.assertEqual(c, b"")
1594 self.assertEqual(b, b"")
1595 self.assertEqual(c, b"")
1598 self.assertEqual(b, b"")
1599 self.assertEqual(c, b"")
1602 self.assertEqual(c, b"")
1604 self.assertEqual(b, b"")
1605 self.assertEqual(c, b"")
1619 self.assertEqual(b, orig)
1621 self.assertEqual(b, orig)
1623 self.assertEqual(b, orig)
1626 self.assertEqual(b, orig)
1628 self.assertEqual(b, orig)
1632 self.assertEqual(b, orig)
1637 self.assertEqual(b, orig)
1653 self.assertEqual(type(it), type(itorig))
1654 self.assertEqual(list(it), data)
1661 self.assertEqual(type(it), type(itorig))
1662 self.assertEqual(list(it), data[1:])
1670 self.assertEqual(type(it), type(itorig))
1671 self.assertEqual(list(it), data[len(orig):])
1678 self.assertEqual(list(it), [])
1689 self.assertEqual(list(it), [])
1697 self.assertEqual(b1, b'xc')
1698 self.assertEqual(b1, b)
1699 self.assertEqual(b3, b'xcxcxc')
1710 self.assertEqual(f(bytearray()), "bytearray(b'')")
1711 self.assertEqual(f(bytearray([0])), "bytearray(b'\\x00')")
1712 self.assertEqual(f(bytearray([0, 1, 254, 255])),
1714 self.assertEqual(f(b"abc"), "b'abc'")
1715 self.assertEqual(f(b"'"), '''b"'"''') # '''
1716 self.assertEqual(f(b"'\""), r"""b'\'"'""") # '
1721 self.assertEqual(format(b), str(b))
1722 self.assertEqual(format(b, ''), str(b))
1728 self.assertEqual(b"abc" == bytes(b"abc"), True)
1729 self.assertEqual(b"ab" != bytes(b"abc"), True)
1730 self.assertEqual(b"ab" <= bytes(b"abc"), True)
1731 self.assertEqual(b"ab" < bytes(b"abc"), True)
1732 self.assertEqual(b"abc" >= bytes(b"ab"), True)
1733 self.assertEqual(b"abc" > bytes(b"ab"), True)
1735 self.assertEqual(b"abc" != bytes(b"abc"), False)
1736 self.assertEqual(b"ab" == bytes(b"abc"), False)
1737 self.assertEqual(b"ab" > bytes(b"abc"), False)
1738 self.assertEqual(b"ab" >= bytes(b"abc"), False)
1739 self.assertEqual(b"abc" < bytes(b"ab"), False)
1740 self.assertEqual(b"abc" <= bytes(b"ab"), False)
1742 self.assertEqual(bytes(b"abc") == b"abc", True)
1743 self.assertEqual(bytes(b"ab") != b"abc", True)
1744 self.assertEqual(bytes(b"ab") <= b"abc", True)
1745 self.assertEqual(bytes(b"ab") < b"abc", True)
1746 self.assertEqual(bytes(b"abc") >= b"ab", True)
1747 self.assertEqual(bytes(b"abc") > b"ab", True)
1749 self.assertEqual(bytes(b"abc") != b"abc", False)
1750 self.assertEqual(bytes(b"ab") == b"abc", False)
1751 self.assertEqual(bytes(b"ab") > b"abc", False)
1752 self.assertEqual(bytes(b"ab") >= b"abc", False)
1753 self.assertEqual(bytes(b"abc") < b"ab", False)
1754 self.assertEqual(bytes(b"abc") <= b"ab", False)
1767 self.assertEqual(b, bytearray(sample))
1771 self.assertEqual(str(b''), "b''")
1772 self.assertEqual(str(b'x'), "b'x'")
1773 self.assertEqual(str(b'\x80'), "b'\\x80'")
1774 self.assertEqual(str(bytearray(b'')), "bytearray(b'')")
1775 self.assertEqual(str(bytearray(b'x')), "bytearray(b'x')")
1776 self.assertEqual(str(bytearray(b'\x80')), "bytearray(b'\\x80')")
1786 self.assertEqual(b, bytearray(s, 'latin-1'))
1792 self.assertEqual(b'a b'.split(memoryview(b' ')), [b'a', b'b'])
1795 self.assertEqual(b'a b'.rsplit(memoryview(b' ')), [b'a', b'b'])
1858 self.assertEqual(val, newval)
1865 self.assertEqual(val, newval)
1870 self.assertEqual(val, newval)
1908 self.assertEqual(a + b, _a + _b)
1909 self.assertEqual(a + b, a + _b)
1910 self.assertEqual(a + b, _a + b)
1935 self.assertEqual(a, b)
1936 self.assertEqual(a.x, b.x)
1937 self.assertEqual(a.y, b.y)
1938 self.assertEqual(type(a), type(b))
1939 self.assertEqual(type(a.y), type(b.y))
1948 self.assertEqual(a, b)
1949 self.assertEqual(a.x, b.x)
1950 self.assertEqual(a.y, b.y)
1951 self.assertEqual(type(a), type(b))
1952 self.assertEqual(type(a.y), type(b.y))
1956 self.assertEqual(b, b'\x1a\x2b\x30')
1966 self.assertEqual(b, b'\x1a\x2b\x30')
1968 self.assertEqual(b.foo, 'bar')
1977 self.assertEqual(b, b'\x1a\x2b\x30')
1979 self.assertEqual(b.foo, 'bar')
2001 self.assertEqual(x, b"abcd")
2003 self.assertEqual(x, b"abcd")