Back to index

python3.2  3.2.2
Public Member Functions
ctypes.test.test_numbers.NumberTestCase Class Reference

List of all members.

Public Member Functions

def test_default_init
def test_unsigned_values
def test_signed_values
def test_bool_values
def test_typeerror

Detailed Description

Definition at line 53 of file test_numbers.py.


Member Function Documentation

Definition at line 73 of file test_numbers.py.

00073 
00074     def test_bool_values(self):
00075         from operator import truth
00076         for t, v in zip(bool_types, bool_values):
00077             self.assertEqual(t(v).value, truth(v))

Here is the call graph for this function:

Definition at line 55 of file test_numbers.py.

00055 
00056     def test_default_init(self):
00057         # default values are set to zero
00058         for t in signed_types + unsigned_types + float_types:
00059             self.assertEqual(t().value, 0)

Here is the call graph for this function:

Definition at line 67 of file test_numbers.py.

00067 
00068     def test_signed_values(self):
00069         # see above
00070         for t, (l, h) in zip(signed_types, signed_ranges):
00071             self.assertEqual(t(l).value, l)
00072             self.assertEqual(t(h).value, h)

Here is the call graph for this function:

Definition at line 78 of file test_numbers.py.

00078 
00079     def test_typeerror(self):
00080         # Only numbers are allowed in the contructor,
00081         # otherwise TypeError is raised
00082         for t in signed_types + unsigned_types + float_types:
00083             self.assertRaises(TypeError, t, "")
00084             self.assertRaises(TypeError, t, None)

Here is the call graph for this function:

Definition at line 60 of file test_numbers.py.

00060 
00061     def test_unsigned_values(self):
00062         # the value given to the constructor is available
00063         # as the 'value' attribute
00064         for t, (l, h) in zip(unsigned_types, unsigned_ranges):
00065             self.assertEqual(t(l).value, l)
00066             self.assertEqual(t(h).value, h)

Here is the call graph for this function:


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