Back to index

python3.2  3.2.2
Public Member Functions
test.test_getargs2.Signed_TestCase Class Reference

List of all members.

Public Member Functions

def test_h
def test_i
def test_l
def test_n

Detailed Description

Definition at line 128 of file test_getargs2.py.


Member Function Documentation

Definition at line 129 of file test_getargs2.py.

00129 
00130     def test_h(self):
00131         from _testcapi import getargs_h
00132         # h returns 'short', and does range checking (SHRT_MIN ... SHRT_MAX)
00133         self.assertRaises(TypeError, getargs_h, 3.14)
00134         self.assertEqual(99, getargs_h(Int()))
00135 
00136         self.assertRaises(OverflowError, getargs_h, SHRT_MIN-1)
00137         self.assertEqual(SHRT_MIN, getargs_h(SHRT_MIN))
00138         self.assertEqual(SHRT_MAX, getargs_h(SHRT_MAX))
00139         self.assertRaises(OverflowError, getargs_h, SHRT_MAX+1)
00140 
00141         self.assertEqual(42, getargs_h(42))
00142         self.assertRaises(OverflowError, getargs_h, VERY_LARGE)

Here is the call graph for this function:

Definition at line 143 of file test_getargs2.py.

00143 
00144     def test_i(self):
00145         from _testcapi import getargs_i
00146         # i returns 'int', and does range checking (INT_MIN ... INT_MAX)
00147         self.assertRaises(TypeError, getargs_i, 3.14)
00148         self.assertEqual(99, getargs_i(Int()))
00149 
00150         self.assertRaises(OverflowError, getargs_i, INT_MIN-1)
00151         self.assertEqual(INT_MIN, getargs_i(INT_MIN))
00152         self.assertEqual(INT_MAX, getargs_i(INT_MAX))
00153         self.assertRaises(OverflowError, getargs_i, INT_MAX+1)
00154 
00155         self.assertEqual(42, getargs_i(42))
00156         self.assertRaises(OverflowError, getargs_i, VERY_LARGE)

Here is the call graph for this function:

Definition at line 157 of file test_getargs2.py.

00157 
00158     def test_l(self):
00159         from _testcapi import getargs_l
00160         # l returns 'long', and does range checking (LONG_MIN ... LONG_MAX)
00161         self.assertRaises(TypeError, getargs_l, 3.14)
00162         self.assertEqual(99, getargs_l(Int()))
00163 
00164         self.assertRaises(OverflowError, getargs_l, LONG_MIN-1)
00165         self.assertEqual(LONG_MIN, getargs_l(LONG_MIN))
00166         self.assertEqual(LONG_MAX, getargs_l(LONG_MAX))
00167         self.assertRaises(OverflowError, getargs_l, LONG_MAX+1)
00168 
00169         self.assertEqual(42, getargs_l(42))
00170         self.assertRaises(OverflowError, getargs_l, VERY_LARGE)

Here is the call graph for this function:

Definition at line 171 of file test_getargs2.py.

00171 
00172     def test_n(self):
00173         from _testcapi import getargs_n
00174         # n returns 'Py_ssize_t', and does range checking
00175         # (PY_SSIZE_T_MIN ... PY_SSIZE_T_MAX)
00176         self.assertRaises(TypeError, getargs_n, 3.14)
00177         self.assertRaises(TypeError, getargs_n, Int())
00178 
00179         self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MIN-1)
00180         self.assertEqual(PY_SSIZE_T_MIN, getargs_n(PY_SSIZE_T_MIN))
00181         self.assertEqual(PY_SSIZE_T_MAX, getargs_n(PY_SSIZE_T_MAX))
00182         self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MAX+1)
00183 
00184         self.assertEqual(42, getargs_n(42))
00185         self.assertRaises(OverflowError, getargs_n, VERY_LARGE)
00186 

Here is the call graph for this function:


The documentation for this class was generated from the following file: