Lines Matching refs:assertEqual
156 eq = self.assertEqual
230 self.assertEqual(x, y)
233 eq = self.assertEqual
260 eq = self.assertEqual
273 eq = self.assertEqual
312 self.assertEqual(got, expected)
314 self.assertEqual(int(got, 0), x)
338 self.assertEqual(int(ss), vv)
350 self.assertEqual(int('1L', 22), 43)
353 self.assertEqual(int('000', 0), 0)
354 self.assertEqual(int('0o123', 0), 83)
355 self.assertEqual(int('0x123', 0), 291)
356 self.assertEqual(int('0b100', 0), 4)
357 self.assertEqual(int(' 0O123 ', 0), 83)
358 self.assertEqual(int(' 0X123 ', 0), 291)
359 self.assertEqual(int(' 0B100 ', 0), 4)
360 self.assertEqual(int('0', 0), 0)
361 self.assertEqual(int('+0', 0), 0)
362 self.assertEqual(int('-0', 0), 0)
363 self.assertEqual(int('00', 0), 0)
395 self.assertEqual(int(LongTrunc()), 1729)
412 self.assertEqual(actual, expected, msg)
428 self.assertEqual(float(x), x)
429 self.assertEqual(float(-x), -x)
434 self.assertEqual(int(float(2**p*(2**53+x))), 2**p*(2**53+y))
440 self.assertEqual(int(float(2**p*(2**54+x))), 2**p*(2**54+y))
446 self.assertEqual(float(int_dbl_max), DBL_MAX)
447 self.assertEqual(float(int_dbl_max+1), DBL_MAX)
448 self.assertEqual(float(halfway-1), DBL_MAX)
450 self.assertEqual(float(1-halfway), -DBL_MAX)
462 self.assertEqual(int(float(x)), y)
466 self.assertEqual(int(float(x)), y)
486 self.assertEqual(float(int(x)), x)
534 eq = self.assertEqual
626 self.assertEqual(format(123456789, 'd'), '123456789')
627 self.assertEqual(format(123456789, 'd'), '123456789')
628 self.assertEqual(format(123456789, ','), '123,456,789')
629 self.assertEqual(format(123456789, '_'), '123_456_789')
632 self.assertEqual(format(1, "-"), '1')
633 self.assertEqual(format(-1, "-"), '-1')
634 self.assertEqual(format(1, "-3"), ' 1')
635 self.assertEqual(format(-1, "-3"), ' -1')
636 self.assertEqual(format(1, "+3"), ' +1')
637 self.assertEqual(format(-1, "+3"), ' -1')
638 self.assertEqual(format(1, " 3"), ' 1')
639 self.assertEqual(format(-1, " 3"), ' -1')
640 self.assertEqual(format(1, " "), ' 1')
641 self.assertEqual(format(-1, " "), '-1')
644 self.assertEqual(format(3, "x"), "3")
645 self.assertEqual(format(3, "X"), "3")
646 self.assertEqual(format(1234, "x"), "4d2")
647 self.assertEqual(format(-1234, "x"), "-4d2")
648 self.assertEqual(format(1234, "8x"), " 4d2")
649 self.assertEqual(format(-1234, "8x"), " -4d2")
650 self.assertEqual(format(1234, "x"), "4d2")
651 self.assertEqual(format(-1234, "x"), "-4d2")
652 self.assertEqual(format(-3, "x"), "-3")
653 self.assertEqual(format(-3, "X"), "-3")
654 self.assertEqual(format(int('be', 16), "x"), "be")
655 self.assertEqual(format(int('be', 16), "X"), "BE")
656 self.assertEqual(format(-int('be', 16), "x"), "-be")
657 self.assertEqual(format(-int('be', 16), "X"), "-BE")
659 self.assertEqual(format(1234567890, '_x'), '4996_02d2')
660 self.assertEqual(format(1234567890, '_X'), '4996_02D2')
663 self.assertEqual(format(3, "o"), "3")
664 self.assertEqual(format(-3, "o"), "-3")
665 self.assertEqual(format(1234, "o"), "2322")
666 self.assertEqual(format(-1234, "o"), "-2322")
667 self.assertEqual(format(1234, "-o"), "2322")
668 self.assertEqual(format(-1234, "-o"), "-2322")
669 self.assertEqual(format(1234, " o"), " 2322")
670 self.assertEqual(format(-1234, " o"), "-2322")
671 self.assertEqual(format(1234, "+o"), "+2322")
672 self.assertEqual(format(-1234, "+o"), "-2322")
674 self.assertEqual(format(1234567890, '_o'), '111_4540_1322')
677 self.assertEqual(format(3, "b"), "11")
678 self.assertEqual(format(-3, "b"), "-11")
679 self.assertEqual(format(1234, "b"), "10011010010")
680 self.assertEqual(format(-1234, "b"), "-10011010010")
681 self.assertEqual(format(1234, "-b"), "10011010010")
682 self.assertEqual(format(-1234, "-b"), "-10011010010")
683 self.assertEqual(format(1234, " b"), " 10011010010")
684 self.assertEqual(format(-1234, " b"), "-10011010010")
685 self.assertEqual(format(1234, "+b"), "+10011010010")
686 self.assertEqual(format(-1234, "+b"), "-10011010010")
688 self.assertEqual(format(12345, '_b'), '11_0000_0011_1001')
719 self.assertEqual(format(value, format_spec),
731 self.assertEqual(13 % 10, 3)
732 self.assertEqual(-13 % 10, 7)
733 self.assertEqual(13 % -10, -7)
734 self.assertEqual(-13 % -10, -3)
736 self.assertEqual(12 % 4, 0)
737 self.assertEqual(-12 % 4, 0)
738 self.assertEqual(12 % -4, 0)
739 self.assertEqual(-12 % -4, 0)
744 self.assertEqual(huge / huge, 1.0)
745 self.assertEqual(mhuge / mhuge, 1.0)
746 self.assertEqual(huge / mhuge, -1.0)
747 self.assertEqual(mhuge / huge, -1.0)
748 self.assertEqual(1 / huge, 0.0)
749 self.assertEqual(1 / huge, 0.0)
750 self.assertEqual(1 / mhuge, 0.0)
751 self.assertEqual(1 / mhuge, 0.0)
752 self.assertEqual((666 * huge + (huge >> 1)) / huge, 666.5)
753 self.assertEqual((666 * mhuge + (mhuge >> 1)) / mhuge, 666.5)
754 self.assertEqual((666 * huge + (huge >> 1)) / mhuge, -666.5)
755 self.assertEqual((666 * mhuge + (mhuge >> 1)) / huge, -666.5)
756 self.assertEqual(huge / (huge << 1), 0.5)
757 self.assertEqual((1000000 * huge) / huge, 1000000)
769 self.assertEqual(result, 0.0,
779 self.assertEqual(2 // 3, 0)
780 self.assertEqual(2 // -3, -1)
781 self.assertEqual(-2 // 3, -1)
782 self.assertEqual(-2 // -3, 0)
784 self.assertEqual(-11 // -3, 3)
785 self.assertEqual(-11 // 3, -4)
786 self.assertEqual(11 // -3, -4)
787 self.assertEqual(11 // 3, 3)
789 self.assertEqual(-12 // -3, 4)
790 self.assertEqual(-12 // 3, -4)
791 self.assertEqual(12 // -3, -4)
792 self.assertEqual(12 // 3, 4)
821 self.assertEqual(expected, got, "Incorrectly rounded division {}/{}: "
927 self.assertEqual(0 << 0, 0)
928 self.assertEqual(0 << 10, 0)
931 self.assertEqual(0 << (1 << 1000), 0)
940 self.assertEqual(0 << sys.maxsize, 0)
941 self.assertEqual(0 << (sys.maxsize + 1), 0)
946 self.assertEqual(1 << (sys.maxsize + 1000), 1 << 1000 << sys.maxsize)
949 self.assertEqual(42 >> (1 << 1000), 0)
950 self.assertEqual((-42) >> (1 << 1000), -1)
956 self.assertEqual(huge >> (sys.maxsize + 1), (1 << 499) + 5)
957 self.assertEqual(huge >> (sys.maxsize + 1000), 0)
990 self.assertEqual(k, len(bin(x).lstrip('-0b')))
995 self.assertEqual(k, 0)
1002 self.assertEqual(k, 1 + math.floor(
1005 self.assertEqual((0).bit_length(), 0)
1006 self.assertEqual((1).bit_length(), 1)
1007 self.assertEqual((-1).bit_length(), 1)
1008 self.assertEqual((2).bit_length(), 2)
1009 self.assertEqual((-2).bit_length(), 2)
1012 self.assertEqual((a-1).bit_length(), i)
1013 self.assertEqual((1-a).bit_length(), i)
1014 self.assertEqual((a).bit_length(), i+1)
1015 self.assertEqual((-a).bit_length(), i+1)
1016 self.assertEqual((a+1).bit_length(), i+1)
1017 self.assertEqual((-a-1).bit_length(), i+1)
1021 self.assertEqual(a.bit_count(), bin(a).count("1"))
1025 self.assertEqual(a.bit_count(), 1)
1026 self.assertEqual((a - 1).bit_count(), exp)
1027 self.assertEqual((a ^ 63).bit_count(), 7)
1028 self.assertEqual(((a - 1) ^ 510).bit_count(), exp - 8)
1040 self.assertEqual(got, expected)
1044 self.assertEqual(round(-150, -2), -200)
1045 self.assertEqual(round(-149, -2), -100)
1046 self.assertEqual(round(-51, -2), -100)
1047 self.assertEqual(round(-50, -2), 0)
1048 self.assertEqual(round(-49, -2), 0)
1049 self.assertEqual(round(-1, -2), 0)
1050 self.assertEqual(round(0, -2), 0)
1051 self.assertEqual(round(1, -2), 0)
1052 self.assertEqual(round(49, -2), 0)
1053 self.assertEqual(round(50, -2), 0)
1054 self.assertEqual(round(51, -2), 100)
1055 self.assertEqual(round(149, -2), 100)
1056 self.assertEqual(round(150, -2), 200)
1057 self.assertEqual(round(250, -2), 200)
1058 self.assertEqual(round(251, -2), 300)
1059 self.assertEqual(round(172500, -3), 172000)
1060 self.assertEqual(round(173500, -3), 174000)
1061 self.assertEqual(round(31415926535, -1), 31415926540)
1062 self.assertEqual(round(31415926535, -2), 31415926500)
1063 self.assertEqual(round(31415926535, -3), 31415927000)
1064 self.assertEqual(round(31415926535, -4), 31415930000)
1065 self.assertEqual(round(31415926535, -5), 31415900000)
1066 self.assertEqual(round(31415926535, -6), 31416000000)
1067 self.assertEqual(round(31415926535, -7), 31420000000)
1068 self.assertEqual(round(31415926535, -8), 31400000000)
1069 self.assertEqual(round(31415926535, -9), 31000000000)
1070 self.assertEqual(round(31415926535, -10), 30000000000)
1071 self.assertEqual(round(31415926535, -11), 0)
1072 self.assertEqual(round(31415926535, -12), 0)
1073 self.assertEqual(round(31415926535, -999), 0)
1079 self.assertEqual(got, expect)
1087 self.assertEqual(got, x)
1090 self.assertEqual(round(8979323, huge_n), 8979323)
1096 self.assertEqual(got, x)
1108 self.assertEqual(
1196 self.assertEqual((0).to_bytes(0, 'big'), b'')
1197 self.assertEqual((1).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x01')
1198 self.assertEqual((0).to_bytes(5, 'big'), b'\x00\x00\x00\x00\x00')
1199 self.assertEqual((-1).to_bytes(5, 'big', signed=True),
1207 self.assertEqual(
1303 self.assertEqual(myint.from_bytes(b'\x01', 'big'), 1)
1306 self.assertEqual(myint.from_bytes(b'\x01', 'big', signed=False), 1)
1308 self.assertEqual(myint.from_bytes(b'\x01', 'little'), 1)
1311 self.assertEqual(myint.from_bytes(b'\x01', 'little', signed=False), 1)
1312 self.assertEqual(
1314 self.assertEqual(
1316 self.assertEqual(int.from_bytes(
1318 self.assertEqual(int.from_bytes(
1320 self.assertEqual(int.from_bytes(
1322 self.assertEqual(int.from_bytes(
1342 self.assertEqual(i, 2)
1350 self.assertEqual(i, 1)
1351 self.assertEqual(getattr(i, 'foo', 'none'), 'bar')
1365 self.assertEqual(n, 0)
1371 self.assertEqual(type(value << shift), int)
1372 self.assertEqual(type(value >> shift), int)
1380 self.assertEqual((numerator, denominator), (int(value), 1))
1381 self.assertEqual(type(numerator), int)
1382 self.assertEqual(type(denominator), int)