Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_float.FormatFunctionsTestCase Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_getformat
def test_setformat

Public Attributes

 save_formats

Detailed Description

Definition at line 418 of file test_float.py.


Member Function Documentation

Definition at line 420 of file test_float.py.

00420 
00421     def setUp(self):
00422         self.save_formats = {'double':float.__getformat__('double'),
00423                              'float':float.__getformat__('float')}

Here is the caller graph for this function:

Definition at line 424 of file test_float.py.

00424 
00425     def tearDown(self):
00426         float.__setformat__('double', self.save_formats['double'])
00427         float.__setformat__('float', self.save_formats['float'])

Here is the caller graph for this function:

Definition at line 428 of file test_float.py.

00428 
00429     def test_getformat(self):
00430         self.assertIn(float.__getformat__('double'),
00431                       ['unknown', 'IEEE, big-endian', 'IEEE, little-endian'])
00432         self.assertIn(float.__getformat__('float'),
00433                       ['unknown', 'IEEE, big-endian', 'IEEE, little-endian'])
00434         self.assertRaises(ValueError, float.__getformat__, 'chicken')
00435         self.assertRaises(TypeError, float.__getformat__, 1)

Here is the call graph for this function:

Definition at line 436 of file test_float.py.

00436 
00437     def test_setformat(self):
00438         for t in 'double', 'float':
00439             float.__setformat__(t, 'unknown')
00440             if self.save_formats[t] == 'IEEE, big-endian':
00441                 self.assertRaises(ValueError, float.__setformat__,
00442                                   t, 'IEEE, little-endian')
00443             elif self.save_formats[t] == 'IEEE, little-endian':
00444                 self.assertRaises(ValueError, float.__setformat__,
00445                                   t, 'IEEE, big-endian')
00446             else:
00447                 self.assertRaises(ValueError, float.__setformat__,
00448                                   t, 'IEEE, big-endian')
00449                 self.assertRaises(ValueError, float.__setformat__,
00450                                   t, 'IEEE, little-endian')
00451             self.assertRaises(ValueError, float.__setformat__,
00452                               t, 'chicken')
00453         self.assertRaises(ValueError, float.__setformat__,
00454                           'chicken', 'unknown')

Here is the call graph for this function:


Member Data Documentation

Definition at line 421 of file test_float.py.


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