Home
last modified time | relevance | path

Searched refs:assertRaises (Results 1 – 25 of 251) sorted by relevance

1234567891011

/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/
Dtest_operator.py37 self.assertRaises(TypeError, operator.lt)
38 self.assertRaises(TypeError, operator.lt, 1j, 2j)
47 self.assertRaises(TypeError, operator.le)
48 self.assertRaises(TypeError, operator.le, 1j, 2j)
61 self.assertRaises(TypeError, operator.eq)
62 self.assertRaises(SyntaxError, operator.eq, C(), C())
74 self.assertRaises(TypeError, operator.ne)
75 self.assertRaises(SyntaxError, operator.ne, C(), C())
84 self.assertRaises(TypeError, operator.ge)
85 self.assertRaises(TypeError, operator.ge, 1j, 2j)
[all …]
Dtest_call.py12 self.assertRaises(TypeError, {}.has_key)
19 self.assertRaises(TypeError, {}.has_key, 0, 1)
41 self.assertRaises(TypeError, {}.has_key, x=2)
44 self.assertRaises(TypeError, {}.has_key, x=2)
47 self.assertRaises(TypeError, {}.has_key, x=2, y=2)
53 self.assertRaises(TypeError, {}.keys, 0)
56 self.assertRaises(TypeError, {}.keys, 0, 1)
86 self.assertRaises(TypeError, {}.keys, x=2)
89 self.assertRaises(TypeError, {}.keys, x=2, y=2)
92 self.assertRaises(TypeError, [].count)
[all …]
Dtest_str.py36 self.assertRaises(OverflowError, '%c'.__mod__, 0x1234)
107 self.assertRaises(OverflowError, 't\tt\t'.expandtabs, sys.maxint)
322 self.assertRaises(ValueError, '{'.format)
323 self.assertRaises(ValueError, '}'.format)
324 self.assertRaises(ValueError, 'a{'.format)
325 self.assertRaises(ValueError, 'a}'.format)
326 self.assertRaises(ValueError, '{a'.format)
327 self.assertRaises(ValueError, '}a'.format)
328 self.assertRaises(IndexError, '{0}'.format)
329 self.assertRaises(IndexError, '{1}'.format, 'abc')
[all …]
Dtest_builtin.py72 self.assertRaises(ImportError, __import__, 'spamspam')
73 self.assertRaises(TypeError, __import__, 1, 2, 3, 4)
74 self.assertRaises(ValueError, __import__, '')
75 self.assertRaises(TypeError, __import__, 'sys', name='sys')
92 self.assertRaises(TypeError, abs, 'a')
97 self.assertRaises(TypeError, abs)
98 self.assertRaises(TypeError, abs, None)
107 self.assertRaises(RuntimeError, all, [2, TestFailingBool(), 6])
108 self.assertRaises(RuntimeError, all, TestFailingIter())
109 self.assertRaises(TypeError, all, 10) # Non-iterable
[all …]
Dtest_getargs2.py62 self.assertRaises(TypeError, getargs_b, 3.14)
66 self.assertRaises(OverflowError, getargs_b, -1)
69 self.assertRaises(OverflowError, getargs_b, UCHAR_MAX + 1)
73 self.assertRaises(OverflowError, getargs_b, VERY_LARGE)
78 self.assertRaises(TypeError, getargs_B, 3.14)
95 self.assertRaises(TypeError, getargs_H, 3.14)
112 self.assertRaises(TypeError, getargs_I, 3.14)
130 self.assertRaises(TypeError, getargs_k, 3.14)
131 self.assertRaises(TypeError, getargs_k, Long())
132 self.assertRaises(TypeError, getargs_k, Int())
[all …]
Dtest_codeccallbacks.py178 self.assertRaises(UnicodeDecodeError, sin.decode,
192 self.assertRaises(UnicodeError, codecs.charmap_encode, sin, "strict", charmap)
200 self.assertRaises(TypeError, codecs.charmap_encode, sin, "replace", charmap)
203 self.assertRaises(TypeError, codecs.charmap_encode, sin, "replace", charmap)
206 self.assertRaises(
310 self.assertRaises(TypeError, exctype, *args[:-1])
312 self.assertRaises(TypeError, exctype, *(args + ["too much"]))
326 self.assertRaises(TypeError, exctype, *callargs)
407 self.assertRaises(
413 self.assertRaises(
[all …]
Dtest_itertools.py69 self.assertRaises(TypeError, list,c(2, 3))
76 self.assertRaises(TypeError, list, chain.from_iterable([2, 3]))
79 self.assertRaises(TypeError, combinations, 'abc') # missing r argument
80 self.assertRaises(TypeError, combinations, 'abc', 2, 1) # too many arguments
81 self.assertRaises(TypeError, combinations, None) # pool is not iterable
82 self.assertRaises(ValueError, combinations, 'abc', -2) # r is negative
146 self.assertRaises(TypeError, cwr, 'abc') # missing r argument
147 self.assertRaises(TypeError, cwr, 'abc', 2, 1) # too many arguments
148 self.assertRaises(TypeError, cwr, None) # pool is not iterable
149 self.assertRaises(ValueError, cwr, 'abc', -2) # r is negative
[all …]
Dtest_time.py45 with self.assertRaises(ValueError):
53 self.assertRaises(ValueError, time.strftime, '',
56 self.assertRaises(ValueError, time.strftime, '',
58 self.assertRaises(ValueError, time.strftime, '',
61 self.assertRaises(ValueError, time.strftime, '',
63 self.assertRaises(ValueError, time.strftime, '',
66 self.assertRaises(ValueError, time.strftime, '',
68 self.assertRaises(ValueError, time.strftime, '',
71 self.assertRaises(ValueError, time.strftime, '',
73 self.assertRaises(ValueError, time.strftime, '',
[all …]
Dlist_tests.py51 self.assertRaises(RuntimeError, repr, l0)
69 self.assertRaises(ValueError, a.__setitem__, slice(0, 10, 0), [1,2,3])
70 self.assertRaises(TypeError, a.__setitem__, slice(0, 10), 1)
71 self.assertRaises(ValueError, a.__setitem__, slice(0, 10, 2), [1,2])
72 self.assertRaises(TypeError, a.__getitem__, 'x', 1)
82 self.assertRaises(StopIteration, r.next)
86 self.assertRaises(TypeError, len, reversed([1,2,3]))
97 self.assertRaises(IndexError, a.__setitem__, -3, 200)
98 self.assertRaises(IndexError, a.__setitem__, 2, 200)
101 self.assertRaises(IndexError, a.__setitem__, 0, 200)
[all …]
Dtest_copy_reg.py30 self.assertRaises(TypeError, copy_reg.pickle,
34 self.assertRaises(TypeError, copy_reg.pickle,
38 self.assertRaises(TypeError, copy_reg.pickle,
50 self.assertRaises(ValueError, copy_reg.remove_extension,
61 self.assertRaises(ValueError, copy_reg.add_extension,
63 self.assertRaises(ValueError, copy_reg.remove_extension,
66 self.assertRaises(ValueError, copy_reg.add_extension,
68 self.assertRaises(ValueError, copy_reg.remove_extension,
71 self.assertRaises(ValueError, copy_reg.add_extension,
73 self.assertRaises(ValueError, copy_reg.remove_extension,
[all …]
Dtest_memoryview.py37 self.assertRaises(IndexError, lambda: m[6])
38 self.assertRaises(IndexError, lambda: m[-7])
39 self.assertRaises(IndexError, lambda: m[sys.maxsize])
40 self.assertRaises(IndexError, lambda: m[-sys.maxsize])
42 self.assertRaises(TypeError, lambda: m[None])
43 self.assertRaises(TypeError, lambda: m[0.0])
44 self.assertRaises(TypeError, lambda: m["a"])
72 self.assertRaises(TypeError, setitem, b"a")
73 self.assertRaises(TypeError, setitem, 65)
74 self.assertRaises(TypeError, setitem, memoryview(b"a"))
[all …]
Dtest_winsound.py41 self.assertRaises(TypeError, winsound.Beep)
42 self.assertRaises(ValueError, winsound.Beep, 36, 75)
43 self.assertRaises(ValueError, winsound.Beep, 32768, 75)
74 self.assertRaises(TypeError, winsound.MessageBeep, "bad")
75 self.assertRaises(TypeError, winsound.MessageBeep, 42, 42)
97 self.assertRaises(TypeError, winsound.PlaySound)
98 self.assertRaises(TypeError, winsound.PlaySound, "bad", "bad")
99 self.assertRaises(
110 self.assertRaises(
121 self.assertRaises(
[all …]
Dtest_pipes.py109 self.assertRaises(ValueError, t.open, 'bogusfile', 'r')
116 self.assertRaises(ValueError, t.open, 'bogusfile', 'w')
122 self.assertRaises(TypeError, t.append, 7, pipes.STDIN_STDOUT)
125 self.assertRaises(ValueError, t.append, 'boguscmd', 'xx')
128 self.assertRaises(ValueError, t.append, 'boguscmd', pipes.SOURCE)
133 self.assertRaises(ValueError, t.append, 'boguscmd', pipes.SINK)
137 self.assertRaises(ValueError, t.append, 'boguscmd $OUT',
140 self.assertRaises(ValueError, t.append, 'boguscmd',
145 self.assertRaises(ValueError, t.append, 'boguscmd $IN',
148 self.assertRaises(ValueError, t.append, 'boguscmd',
[all …]
Dtest_audioop.py172 self.assertRaises(audioop.error,
179 self.assertRaises(audioop.error, audioop.getsample, data, size, 0)
180 self.assertRaises(audioop.error, audioop.max, data, size)
181 self.assertRaises(audioop.error, audioop.minmax, data, size)
182 self.assertRaises(audioop.error, audioop.avg, data, size)
183 self.assertRaises(audioop.error, audioop.rms, data, size)
184 self.assertRaises(audioop.error, audioop.avgpp, data, size)
185 self.assertRaises(audioop.error, audioop.maxpp, data, size)
186 self.assertRaises(audioop.error, audioop.cross, data, size)
187 self.assertRaises(audioop.error, audioop.mul, data, size, 1.0)
[all …]
Dtest_int.py96 self.assertRaises(ValueError, int, '123\0')
97 self.assertRaises(ValueError, int, '53', 40)
101 self.assertRaises(ValueError, int, '123\0', 10)
102 self.assertRaises(ValueError, int, '123\x00 245', 20)
111 self.assertRaises(TypeError, int, 1, 12)
117 self.assertRaises(ValueError, int, "0x", 16)
118 self.assertRaises(ValueError, int, "0x", 0)
120 self.assertRaises(ValueError, int, "0o", 8)
121 self.assertRaises(ValueError, int, "0o", 0)
123 self.assertRaises(ValueError, int, "0b", 2)
[all …]
Dtest_unicode.py67 self.assertRaises(SyntaxError, eval, 'u\'\\Ufffffffe\'')
68 self.assertRaises(SyntaxError, eval, 'u\'\\Uffffffff\'')
69 self.assertRaises(SyntaxError, eval, 'u\'\\U%08x\'' % 0x110000)
127 self.assertRaises(TypeError, u'hello'.find)
128 self.assertRaises(TypeError, u'hello'.find, 42)
145 self.assertRaises(ValueError, t1('abcdefghiabc').index, t2('hib'))
146 self.assertRaises(ValueError, t1('abcdefghiab').index, t2('abc'), 1)
147 self.assertRaises(ValueError, t1('abcdefghi').index, t2('ghi'), 8)
148 self.assertRaises(ValueError, t1('abcdefghi').index, t2('ghi'), -1)
159 self.assertRaises(ValueError, t1('abcdefghiabc').rindex, t2('hib'))
[all …]
Dtest_complex.py103 self.assertRaises(ZeroDivisionError, complex.__div__, 1+1j, 0+0j)
109 self.assertRaises(ZeroDivisionError, complex.__truediv__, 1+1j, 0+0j)
113 self.assertRaises(ZeroDivisionError, complex.__floordiv__, 3+0j, 0+0j)
116 self.assertRaises(OverflowError, complex.__coerce__, 1+1j, 1L<<10000)
128 self.assertRaises(TypeError, lambda: a + 2.0j)
138 self.assertRaises(TypeError, complex.__lt__, 1+1j, 2+2j)
139 self.assertRaises(TypeError, complex.__le__, 1+1j, 2+2j)
140 self.assertRaises(TypeError, complex.__gt__, 1+1j, 2+2j)
141 self.assertRaises(TypeError, complex.__ge__, 1+1j, 2+2j)
161 self.assertRaises(ZeroDivisionError, (1+1j).__mod__, 0+0j)
[all …]
Dtest_types.py49 self.assertRaises(ValueError, float, '')
50 self.assertRaises(ValueError, float, '5\0')
243 self.assertRaises(TypeError, type, 1, 2)
244 self.assertRaises(TypeError, type, 1, 2, 3, 4)
247 self.assertRaises(ValueError, buffer, 'asdf', -1)
250 self.assertRaises(TypeError, buffer, None)
271 self.assertRaises(ValueError, buffer, buffer('asdf', 1), -1)
414 self.assertRaises(ValueError, 3 .__format__, "1.3")
416 self.assertRaises(ValueError, 3 .__format__, "+c")
418 self.assertRaises(TypeError, 3 .__format__, None)
[all …]
Dtest_float.py36 self.assertRaises(ValueError, float, " 0x3.1 ")
37 self.assertRaises(ValueError, float, " -0x3.p-1 ")
38 self.assertRaises(ValueError, float, " +0x3.p-1 ")
39 self.assertRaises(ValueError, float, "++3.14")
40 self.assertRaises(ValueError, float, "+-3.14")
41 self.assertRaises(ValueError, float, "-+3.14")
42 self.assertRaises(ValueError, float, "--3.14")
44 self.assertRaises(ValueError, float, "-1.7d29")
45 self.assertRaises(ValueError, float, "3D-14")
115 self.assertRaises(ValueError, float, " 3,14 ")
[all …]
Dtest_memoryio.py48 self.assertRaises(TypeError, bytesIo.seek, 0.0)
65 self.assertRaises(self.UnsupportedOperation, buf.detach)
89 self.assertRaises(TypeError, memio.write, None)
91 self.assertRaises(ValueError, memio.write, self.buftype(""))
102 self.assertRaises(TypeError, memio.writelines, [buf] + [1])
104 self.assertRaises(TypeError, memio.writelines, None)
106 self.assertRaises(ValueError, memio.writelines, [])
114 self.assertRaises(KeyboardInterrupt, memio.writelines, error_gen())
120 self.assertRaises(ValueError, memio.truncate, -1)
136 self.assertRaises(TypeError, memio.truncate, '0')
[all …]
Dtest_ucn.py85 self.assertRaises(ValueError, unicodedata.name, u"\ud7a4")
113 self.assertRaises(TypeError, unicodedata.name)
114 self.assertRaises(TypeError, unicodedata.name, u'xx')
115 self.assertRaises(TypeError, unicodedata.lookup)
116 self.assertRaises(KeyError, unicodedata.lookup, u'unknown')
120 self.assertRaises(
125 self.assertRaises(
130 self.assertRaises(
135 self.assertRaises(
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/unittest/test/
Dtest_case.py436 self.assertRaises(self.failureException, self.assertIs, thing, object())
441 self.assertRaises(self.failureException, self.assertIsNot, thing, thing)
446 self.assertRaises(self.failureException, self.assertIsInstance,
452 self.assertRaises(self.failureException, self.assertNotIsInstance,
466 self.assertRaises(self.failureException, self.assertIn, 'x', 'abc')
467 self.assertRaises(self.failureException, self.assertIn, 4, [1, 2, 3])
468 self.assertRaises(self.failureException, self.assertIn, 'elephant',
471 self.assertRaises(self.failureException, self.assertNotIn, 'c', 'abc')
472 self.assertRaises(self.failureException, self.assertNotIn, 1, [1, 2, 3])
473 self.assertRaises(self.failureException, self.assertNotIn, 'cow',
[all …]
Dtest_assertions.py10 self.assertRaises(self.failureException,
12 self.assertRaises(self.failureException,
16 self.assertRaises(self.failureException,
21 self.assertRaises(self.failureException,
23 self.assertRaises(self.failureException,
27 self.assertRaises(self.failureException, self.assertNotAlmostEqual,
36 self.assertRaises(self.failureException, self.assertAlmostEqual,
38 self.assertRaises(self.failureException, self.assertNotAlmostEqual,
41 self.assertRaises(TypeError, self.assertAlmostEqual,
43 self.assertRaises(TypeError, self.assertNotAlmostEqual,
[all …]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Lib/json/tests/
Dtest_recursion.py72 with self.assertRaises(RuntimeError):
74 with self.assertRaises(RuntimeError):
76 with self.assertRaises(RuntimeError):
79 with self.assertRaises(RuntimeError):
81 with self.assertRaises(RuntimeError):
83 with self.assertRaises(RuntimeError):
91 with self.assertRaises(RuntimeError):
93 with self.assertRaises(RuntimeError):
103 with self.assertRaises(RuntimeError):
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/json/tests/
Dtest_recursion.py72 with self.assertRaises(RuntimeError):
74 with self.assertRaises(RuntimeError):
76 with self.assertRaises(RuntimeError):
79 with self.assertRaises(RuntimeError):
81 with self.assertRaises(RuntimeError):
83 with self.assertRaises(RuntimeError):
91 with self.assertRaises(RuntimeError):
93 with self.assertRaises(RuntimeError):
103 with self.assertRaises(RuntimeError):

1234567891011