Back to index

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

List of all members.

Public Member Functions

def test_b
def test_B
def test_H
def test_I
def test_k

Detailed Description

Definition at line 53 of file test_getargs2.py.


Member Function Documentation

Definition at line 54 of file test_getargs2.py.

00054 
00055     def test_b(self):
00056         from _testcapi import getargs_b
00057         # b returns 'unsigned char', and does range checking (0 ... UCHAR_MAX)
00058         self.assertRaises(TypeError, getargs_b, 3.14)
00059         self.assertEqual(99, getargs_b(Int()))
00060 
00061         self.assertRaises(OverflowError, getargs_b, -1)
00062         self.assertEqual(0, getargs_b(0))
00063         self.assertEqual(UCHAR_MAX, getargs_b(UCHAR_MAX))
00064         self.assertRaises(OverflowError, getargs_b, UCHAR_MAX + 1)
00065 
00066         self.assertEqual(42, getargs_b(42))
00067         self.assertRaises(OverflowError, getargs_b, VERY_LARGE)

Here is the call graph for this function:

Definition at line 68 of file test_getargs2.py.

00068 
00069     def test_B(self):
00070         from _testcapi import getargs_B
00071         # B returns 'unsigned char', no range checking
00072         self.assertRaises(TypeError, getargs_B, 3.14)
00073         self.assertEqual(99, getargs_B(Int()))
00074 
00075         self.assertEqual(UCHAR_MAX, getargs_B(-1))
00076         self.assertEqual(0, getargs_B(0))
00077         self.assertEqual(UCHAR_MAX, getargs_B(UCHAR_MAX))
00078         self.assertEqual(0, getargs_B(UCHAR_MAX+1))
00079 
00080         self.assertEqual(42, getargs_B(42))
00081         self.assertEqual(UCHAR_MAX & VERY_LARGE, getargs_B(VERY_LARGE))

Here is the call graph for this function:

Definition at line 82 of file test_getargs2.py.

00082 
00083     def test_H(self):
00084         from _testcapi import getargs_H
00085         # H returns 'unsigned short', no range checking
00086         self.assertRaises(TypeError, getargs_H, 3.14)
00087         self.assertEqual(99, getargs_H(Int()))
00088 
00089         self.assertEqual(USHRT_MAX, getargs_H(-1))
00090         self.assertEqual(0, getargs_H(0))
00091         self.assertEqual(USHRT_MAX, getargs_H(USHRT_MAX))
00092         self.assertEqual(0, getargs_H(USHRT_MAX+1))
00093 
00094         self.assertEqual(42, getargs_H(42))
00095 
00096         self.assertEqual(VERY_LARGE & USHRT_MAX, getargs_H(VERY_LARGE))

Here is the call graph for this function:

Definition at line 97 of file test_getargs2.py.

00097 
00098     def test_I(self):
00099         from _testcapi import getargs_I
00100         # I returns 'unsigned int', no range checking
00101         self.assertRaises(TypeError, getargs_I, 3.14)
00102         self.assertEqual(99, getargs_I(Int()))
00103 
00104         self.assertEqual(UINT_MAX, getargs_I(-1))
00105         self.assertEqual(0, getargs_I(0))
00106         self.assertEqual(UINT_MAX, getargs_I(UINT_MAX))
00107         self.assertEqual(0, getargs_I(UINT_MAX+1))
00108 
00109         self.assertEqual(42, getargs_I(42))
00110 
00111         self.assertEqual(VERY_LARGE & UINT_MAX, getargs_I(VERY_LARGE))

Here is the call graph for this function:

Definition at line 112 of file test_getargs2.py.

00112 
00113     def test_k(self):
00114         from _testcapi import getargs_k
00115         # k returns 'unsigned long', no range checking
00116         # it does not accept float, or instances with __int__
00117         self.assertRaises(TypeError, getargs_k, 3.14)
00118         self.assertRaises(TypeError, getargs_k, Int())
00119 
00120         self.assertEqual(ULONG_MAX, getargs_k(-1))
00121         self.assertEqual(0, getargs_k(0))
00122         self.assertEqual(ULONG_MAX, getargs_k(ULONG_MAX))
00123         self.assertEqual(0, getargs_k(ULONG_MAX+1))
00124 
00125         self.assertEqual(42, getargs_k(42))
00126 
00127         self.assertEqual(VERY_LARGE & ULONG_MAX, getargs_k(VERY_LARGE))

Here is the call graph for this function:


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