Lines Matching refs:assertEqual
137 self.assertEqual(99, getargs_b(Int()))
138 self.assertEqual(0, getargs_b(IntSubclass()))
141 self.assertEqual(1, getargs_b(BadInt2()))
142 self.assertEqual(0, getargs_b(BadInt3()))
145 self.assertEqual(0, getargs_b(0))
146 self.assertEqual(UCHAR_MAX, getargs_b(UCHAR_MAX))
149 self.assertEqual(42, getargs_b(42))
156 self.assertEqual(99, getargs_B(Int()))
157 self.assertEqual(0, getargs_B(IntSubclass()))
160 self.assertEqual(1, getargs_B(BadInt2()))
161 self.assertEqual(0, getargs_B(BadInt3()))
163 self.assertEqual(UCHAR_MAX, getargs_B(-1))
164 self.assertEqual(0, getargs_B(0))
165 self.assertEqual(UCHAR_MAX, getargs_B(UCHAR_MAX))
166 self.assertEqual(0, getargs_B(UCHAR_MAX+1))
168 self.assertEqual(42, getargs_B(42))
169 self.assertEqual(UCHAR_MAX & VERY_LARGE, getargs_B(VERY_LARGE))
175 self.assertEqual(99, getargs_H(Int()))
176 self.assertEqual(0, getargs_H(IntSubclass()))
179 self.assertEqual(1, getargs_H(BadInt2()))
180 self.assertEqual(0, getargs_H(BadInt3()))
182 self.assertEqual(USHRT_MAX, getargs_H(-1))
183 self.assertEqual(0, getargs_H(0))
184 self.assertEqual(USHRT_MAX, getargs_H(USHRT_MAX))
185 self.assertEqual(0, getargs_H(USHRT_MAX+1))
187 self.assertEqual(42, getargs_H(42))
189 self.assertEqual(VERY_LARGE & USHRT_MAX, getargs_H(VERY_LARGE))
195 self.assertEqual(99, getargs_I(Int()))
196 self.assertEqual(0, getargs_I(IntSubclass()))
199 self.assertEqual(1, getargs_I(BadInt2()))
200 self.assertEqual(0, getargs_I(BadInt3()))
202 self.assertEqual(UINT_MAX, getargs_I(-1))
203 self.assertEqual(0, getargs_I(0))
204 self.assertEqual(UINT_MAX, getargs_I(UINT_MAX))
205 self.assertEqual(0, getargs_I(UINT_MAX+1))
207 self.assertEqual(42, getargs_I(42))
209 self.assertEqual(VERY_LARGE & UINT_MAX, getargs_I(VERY_LARGE))
217 self.assertEqual(0, getargs_k(IntSubclass()))
220 self.assertEqual(0, getargs_k(BadInt3()))
222 self.assertEqual(ULONG_MAX, getargs_k(-1))
223 self.assertEqual(0, getargs_k(0))
224 self.assertEqual(ULONG_MAX, getargs_k(ULONG_MAX))
225 self.assertEqual(0, getargs_k(ULONG_MAX+1))
227 self.assertEqual(42, getargs_k(42))
229 self.assertEqual(VERY_LARGE & ULONG_MAX, getargs_k(VERY_LARGE))
236 self.assertEqual(99, getargs_h(Int()))
237 self.assertEqual(0, getargs_h(IntSubclass()))
240 self.assertEqual(1, getargs_h(BadInt2()))
241 self.assertEqual(0, getargs_h(BadInt3()))
244 self.assertEqual(SHRT_MIN, getargs_h(SHRT_MIN))
245 self.assertEqual(SHRT_MAX, getargs_h(SHRT_MAX))
248 self.assertEqual(42, getargs_h(42))
255 self.assertEqual(99, getargs_i(Int()))
256 self.assertEqual(0, getargs_i(IntSubclass()))
259 self.assertEqual(1, getargs_i(BadInt2()))
260 self.assertEqual(0, getargs_i(BadInt3()))
263 self.assertEqual(INT_MIN, getargs_i(INT_MIN))
264 self.assertEqual(INT_MAX, getargs_i(INT_MAX))
267 self.assertEqual(42, getargs_i(42))
274 self.assertEqual(99, getargs_l(Int()))
275 self.assertEqual(0, getargs_l(IntSubclass()))
278 self.assertEqual(1, getargs_l(BadInt2()))
279 self.assertEqual(0, getargs_l(BadInt3()))
282 self.assertEqual(LONG_MIN, getargs_l(LONG_MIN))
283 self.assertEqual(LONG_MAX, getargs_l(LONG_MAX))
286 self.assertEqual(42, getargs_l(42))
295 self.assertEqual(0, getargs_n(IntSubclass()))
298 self.assertEqual(0, getargs_n(BadInt3()))
301 self.assertEqual(PY_SSIZE_T_MIN, getargs_n(PY_SSIZE_T_MIN))
302 self.assertEqual(PY_SSIZE_T_MAX, getargs_n(PY_SSIZE_T_MAX))
305 self.assertEqual(42, getargs_n(42))
316 self.assertEqual(99, getargs_L(Int()))
317 self.assertEqual(0, getargs_L(IntSubclass()))
320 self.assertEqual(1, getargs_L(BadInt2()))
321 self.assertEqual(0, getargs_L(BadInt3()))
324 self.assertEqual(LLONG_MIN, getargs_L(LLONG_MIN))
325 self.assertEqual(LLONG_MAX, getargs_L(LLONG_MAX))
328 self.assertEqual(42, getargs_L(42))
336 self.assertEqual(0, getargs_K(IntSubclass()))
339 self.assertEqual(0, getargs_K(BadInt3()))
341 self.assertEqual(ULLONG_MAX, getargs_K(ULLONG_MAX))
342 self.assertEqual(0, getargs_K(0))
343 self.assertEqual(0, getargs_K(ULLONG_MAX+1))
345 self.assertEqual(42, getargs_K(42))
347 self.assertEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE))
352 self.assertEqual(actual, expected)
353 self.assertEqual(math.copysign(1, actual), math.copysign(1, expected))
357 self.assertEqual(getargs_f(4.25), 4.25)
358 self.assertEqual(getargs_f(4), 4.0)
360 self.assertEqual(getargs_f(Float()), 4.25)
361 self.assertEqual(getargs_f(FloatSubclass(7.5)), 7.5)
362 self.assertEqual(getargs_f(FloatSubclass2(7.5)), 7.5)
365 self.assertEqual(getargs_f(BadFloat2()), 4.25)
366 self.assertEqual(getargs_f(BadFloat3(7.5)), 7.5)
369 self.assertEqual(getargs_f(x), x)
371 self.assertEqual(getargs_f(DBL_MAX), INF)
372 self.assertEqual(getargs_f(-DBL_MAX), -INF)
384 self.assertEqual(getargs_f(3.40282356e38), FLT_MAX)
385 self.assertEqual(getargs_f(-3.40282356e38), -FLT_MAX)
389 self.assertEqual(getargs_d(4.25), 4.25)
390 self.assertEqual(getargs_d(4), 4.0)
392 self.assertEqual(getargs_d(Float()), 4.25)
393 self.assertEqual(getargs_d(FloatSubclass(7.5)), 7.5)
394 self.assertEqual(getargs_d(FloatSubclass2(7.5)), 7.5)
397 self.assertEqual(getargs_d(BadFloat2()), 4.25)
398 self.assertEqual(getargs_d(BadFloat3(7.5)), 7.5)
401 self.assertEqual(getargs_d(x), x)
411 self.assertEqual(getargs_D(4.25+0.5j), 4.25+0.5j)
412 self.assertEqual(getargs_D(4.25), 4.25+0j)
413 self.assertEqual(getargs_D(4), 4.0+0j)
414 self.assertEqual(getargs_D(Complex()), 4.25+0.5j)
415 self.assertEqual(getargs_D(ComplexSubclass(7.5+0.25j)), 7.5+0.25j)
416 self.assertEqual(getargs_D(ComplexSubclass2(7.5+0.25j)), 7.5+0.25j)
419 self.assertEqual(getargs_D(BadComplex2()), 4.25+0.5j)
420 self.assertEqual(getargs_D(BadComplex3(7.5+0.25j)), 7.5+0.25j)
424 self.assertEqual(getargs_D(c), c)
426 self.assertEqual(getargs_D(c), c)
441 self.assertEqual(0, getargs_p(False))
442 self.assertEqual(0, getargs_p(None))
443 self.assertEqual(0, getargs_p(0))
444 self.assertEqual(0, getargs_p(0.0))
445 self.assertEqual(0, getargs_p(0j))
446 self.assertEqual(0, getargs_p(''))
447 self.assertEqual(0, getargs_p(()))
448 self.assertEqual(0, getargs_p([]))
449 self.assertEqual(0, getargs_p({}))
451 self.assertEqual(1, getargs_p(True))
452 self.assertEqual(1, getargs_p(1))
453 self.assertEqual(1, getargs_p(1.0))
454 self.assertEqual(1, getargs_p(1j))
455 self.assertEqual(1, getargs_p('x'))
456 self.assertEqual(1, getargs_p((1,)))
457 self.assertEqual(1, getargs_p([1]))
458 self.assertEqual(1, getargs_p({1:2}))
459 self.assertEqual(1, getargs_p(unittest.TestCase))
469 self.assertEqual(ret, (1, 2))
473 self.assertEqual(ret, (1, 2, 3))
477 self.assertEqual(ret, (1, 2))
481 self.assertEqual(ret, (1, 2))
496 self.assertEqual(ret, (1,2,3))
511 self.assertEqual(ret, {'a': 1, 'b': 2})
515 self.assertEqual(ret, {'a': 1, 'b': 2, 'c': 3})
519 self.assertEqual(ret, {'a': 1, 'b': 2})
532 self.assertEqual(
539 self.assertEqual(
546 self.assertEqual(
553 self.assertEqual(
563 self.assertEqual(
572 self.assertEqual(str(err), "function takes at most 5 arguments (6 given)")
581 self.assertEqual(str(err), "'arg666' is an invalid keyword argument for this function")
589 self.assertEqual(str(err), "'\udc80' is an invalid keyword argument for this function")
596 self.assertEqual(
603 self.assertEqual(
610 self.assertEqual(
617 self.assertEqual(
621 self.assertEqual(
627 self.assertEqual(
631 self.assertEqual(
670 self.assertEqual(self.getargs(1, 2, 3), (1, 2, 3))
674 self.assertEqual(self.getargs(1, 2, keyword=3), (1, 2, 3))
678 self.assertEqual(self.getargs(1, 2), (1, 2, -1))
679 self.assertEqual(self.getargs(1, keyword=3), (1, -1, 3))
682 self.assertEqual(self.getargs(1), (1, -1, -1))
702 self.assertEqual(getargs_c(b'a'), 97)
703 self.assertEqual(getargs_c(bytearray(b'a')), 97)
712 self.assertEqual(getargs_y(b'bytes'), b'bytes')
721 self.assertEqual(getargs_y_star(b'bytes'), b'bytes')
722 self.assertEqual(getargs_y_star(b'nul:\0'), b'nul:\0')
723 self.assertEqual(getargs_y_star(bytearray(b'bytearray')), b'bytearray')
724 self.assertEqual(getargs_y_star(memoryview(b'memoryview')), b'memoryview')
730 self.assertEqual(getargs_y_hash(b'bytes'), b'bytes')
731 self.assertEqual(getargs_y_hash(b'nul:\0'), b'nul:\0')
744 self.assertEqual(getargs_w_star(buf), b'[ytearra]')
745 self.assertEqual(buf, bytearray(b'[ytearra]'))
747 self.assertEqual(getargs_w_star(memoryview(buf)), b'[emoryvie]')
748 self.assertEqual(buf, bytearray(b'[emoryvie]'))
756 self.assertEqual(getargs_C('a'), 97)
757 self.assertEqual(getargs_C('\u20ac'), 0x20ac)
758 self.assertEqual(getargs_C('\U0001f40d'), 0x1f40d)
767 self.assertEqual(getargs_s('abc\xe9'), b'abc\xc3\xa9')
776 self.assertEqual(getargs_s_star('abc\xe9'), b'abc\xc3\xa9')
777 self.assertEqual(getargs_s_star('nul:\0'), b'nul:\0')
778 self.assertEqual(getargs_s_star(b'bytes'), b'bytes')
779 self.assertEqual(getargs_s_star(bytearray(b'bytearray')), b'bytearray')
780 self.assertEqual(getargs_s_star(memoryview(b'memoryview')), b'memoryview')
785 self.assertEqual(getargs_s_hash('abc\xe9'), b'abc\xc3\xa9')
786 self.assertEqual(getargs_s_hash('nul:\0'), b'nul:\0')
787 self.assertEqual(getargs_s_hash(b'bytes'), b'bytes')
794 self.assertEqual(getargs_z('abc\xe9'), b'abc\xc3\xa9')
803 self.assertEqual(getargs_z_star('abc\xe9'), b'abc\xc3\xa9')
804 self.assertEqual(getargs_z_star('nul:\0'), b'nul:\0')
805 self.assertEqual(getargs_z_star(b'bytes'), b'bytes')
806 self.assertEqual(getargs_z_star(bytearray(b'bytearray')), b'bytearray')
807 self.assertEqual(getargs_z_star(memoryview(b'memoryview')), b'memoryview')
812 self.assertEqual(getargs_z_hash('abc\xe9'), b'abc\xc3\xa9')
813 self.assertEqual(getargs_z_hash('nul:\0'), b'nul:\0')
814 self.assertEqual(getargs_z_hash(b'bytes'), b'bytes')
821 self.assertEqual(getargs_es('abc\xe9'), b'abc\xc3\xa9')
822 self.assertEqual(getargs_es('abc\xe9', 'latin1'), b'abc\xe9')
833 self.assertEqual(getargs_et('abc\xe9'), b'abc\xc3\xa9')
834 self.assertEqual(getargs_et('abc\xe9', 'latin1'), b'abc\xe9')
837 self.assertEqual(getargs_et(b'bytes', 'latin1'), b'bytes')
838 self.assertEqual(getargs_et(bytearray(b'bytearray'), 'latin1'), b'bytearray')
847 self.assertEqual(getargs_es_hash('abc\xe9'), b'abc\xc3\xa9')
848 self.assertEqual(getargs_es_hash('abc\xe9', 'latin1'), b'abc\xe9')
855 self.assertEqual(getargs_es_hash('nul:\0', 'latin1'), b'nul:\0')
858 self.assertEqual(getargs_es_hash('abc\xe9', 'latin1', buf), b'abc\xe9')
859 self.assertEqual(buf, bytearray(b'abc\xe9\x00xxx'))
861 self.assertEqual(getargs_es_hash('abc\xe9', 'latin1', buf), b'abc\xe9')
862 self.assertEqual(buf, bytearray(b'abc\xe9\x00'))
865 self.assertEqual(buf, bytearray(b'x'*4))
871 self.assertEqual(getargs_et_hash('abc\xe9'), b'abc\xc3\xa9')
872 self.assertEqual(getargs_et_hash('abc\xe9', 'latin1'), b'abc\xe9')
875 self.assertEqual(getargs_et_hash(b'bytes', 'latin1'), b'bytes')
876 self.assertEqual(getargs_et_hash(bytearray(b'bytearray'), 'latin1'), b'bytearray')
879 self.assertEqual(getargs_et_hash('nul:\0', 'latin1'), b'nul:\0')
880 self.assertEqual(getargs_et_hash(b'nul:\0', 'latin1'), b'nul:\0')
881 self.assertEqual(getargs_et_hash(bytearray(b'nul:\0'), 'latin1'), b'nul:\0')
884 self.assertEqual(getargs_et_hash('abc\xe9', 'latin1', buf), b'abc\xe9')
885 self.assertEqual(buf, bytearray(b'abc\xe9\x00xxx'))
887 self.assertEqual(getargs_et_hash('abc\xe9', 'latin1', buf), b'abc\xe9')
888 self.assertEqual(buf, bytearray(b'abc\xe9\x00'))
891 self.assertEqual(buf, bytearray(b'x'*4))
897 self.assertEqual(getargs_u('abc\xe9'), 'abc\xe9')
906 self.assertEqual(getargs_u_hash('abc\xe9'), 'abc\xe9')
907 self.assertEqual(getargs_u_hash('nul:\0'), 'nul:\0')
915 self.assertEqual(getargs_Z('abc\xe9'), 'abc\xe9')
924 self.assertEqual(getargs_Z_hash('abc\xe9'), 'abc\xe9')
925 self.assertEqual(getargs_Z_hash('nul:\0'), 'nul:\0')
963 self.assertEqual(_testcapi.argparsing("Hello", "World"), 1)