Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
test.test_multiprocessing._TestContainers Class Reference
Inheritance diagram for test.test_multiprocessing._TestContainers:
Inheritance graph
[legend]
Collaboration diagram for test.test_multiprocessing._TestContainers:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_list
def test_dict
def test_namespace
def assertTimingAlmostEqual
def assertReturnsIfImplemented
def __reduce__

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

tuple ALLOWED_TYPES = ('manager',)

Detailed Description

Definition at line 975 of file test_multiprocessing.py.


Member Function Documentation

def test.test_multiprocessing.BaseTestCase.__reduce__ (   self,
  args 
) [inherited]

Definition at line 124 of file test_multiprocessing.py.

00124 
00125     def __reduce__(self, *args):
00126         raise NotImplementedError("shouldn't try to pickle a test case")

def test.test_multiprocessing.BaseTestCase.assertReturnsIfImplemented (   self,
  value,
  func,
  args 
) [inherited]

Definition at line 114 of file test_multiprocessing.py.

00114 
00115     def assertReturnsIfImplemented(self, value, func, *args):
00116         try:
00117             res = func(*args)
00118         except NotImplementedError:
00119             pass
00120         else:
00121             return self.assertEqual(value, res)

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_multiprocessing.BaseTestCase.assertTimingAlmostEqual (   self,
  a,
  b 
) [inherited]

Definition at line 110 of file test_multiprocessing.py.

00110 
00111     def assertTimingAlmostEqual(self, a, b):
00112         if CHECK_TIMINGS:
00113             self.assertAlmostEqual(a, b, 1)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1010 of file test_multiprocessing.py.

01010 
01011     def test_dict(self):
01012         d = self.dict()
01013         indices = list(range(65, 70))
01014         for i in indices:
01015             d[i] = chr(i)
01016         self.assertEqual(d.copy(), dict((i, chr(i)) for i in indices))
01017         self.assertEqual(sorted(d.keys()), indices)
01018         self.assertEqual(sorted(d.values()), [chr(i) for i in indices])
01019         self.assertEqual(sorted(d.items()), [(i, chr(i)) for i in indices])

Here is the call graph for this function:

Definition at line 979 of file test_multiprocessing.py.

00979 
00980     def test_list(self):
00981         a = self.list(list(range(10)))
00982         self.assertEqual(a[:], list(range(10)))
00983 
00984         b = self.list()
00985         self.assertEqual(b[:], [])
00986 
00987         b.extend(list(range(5)))
00988         self.assertEqual(b[:], list(range(5)))
00989 
00990         self.assertEqual(b[2], 2)
00991         self.assertEqual(b[2:10], [2,3,4])
00992 
00993         b *= 2
00994         self.assertEqual(b[:], [0, 1, 2, 3, 4, 0, 1, 2, 3, 4])
00995 
00996         self.assertEqual(b + [5, 6], [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6])
00997 
00998         self.assertEqual(a[:], list(range(10)))
00999 
01000         d = [a, b]
01001         e = self.list(d)
01002         self.assertEqual(
01003             e[:],
01004             [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 0, 1, 2, 3, 4]]
01005             )
01006 
01007         f = self.list([a])
01008         a.append('hello')
01009         self.assertEqual(f[:], [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'hello']])

Here is the call graph for this function:

Definition at line 1020 of file test_multiprocessing.py.

01020 
01021     def test_namespace(self):
01022         n = self.Namespace()
01023         n.name = 'Bob'
01024         n.job = 'Builder'
01025         n._hidden = 'hidden'
01026         self.assertEqual((n.name, n.job), ('Bob', 'Builder'))
01027         del n.job
01028         self.assertEqual(str(n), "Namespace(name='Bob')")
01029         self.assertTrue(hasattr(n, 'name'))
01030         self.assertTrue(not hasattr(n, 'job'))
01031 
01032 #
01033 #
01034 #

Here is the call graph for this function:


Member Data Documentation

Reimplemented from test.test_multiprocessing.BaseTestCase.

Definition at line 977 of file test_multiprocessing.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


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