Back to index

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

List of all members.

Public Member Functions

def testSingleArgInlineGeneratorSyntax
def testSingleArgBoundToNonTuple
def testSingleArgBoundToSingleElementParenthesizedList
def testSingleArgBoundToMultipleElementTupleError
def testSingleArgUnbound
def testMultipleArgUnbound
def testMultipleArgBound
def setUp
def assertInWithManagerInvariants
def assertAfterWithManagerInvariants
def assertAfterWithManagerInvariantsNoError
def assertInWithGeneratorInvariants
def assertAfterWithGeneratorInvariantsNoError
def raiseTestException
def assertAfterWithManagerInvariantsWithError
def assertAfterWithGeneratorInvariantsWithError

Public Attributes

 TEST_EXCEPTION
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Definition at line 289 of file test_with.py.


Member Function Documentation

Definition at line 211 of file test_with.py.

00211 
00212     def assertAfterWithGeneratorInvariantsNoError(self, mock_generator):
00213         self.assertTrue(mock_generator.yielded)
00214         self.assertTrue(mock_generator.stopped)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 230 of file test_with.py.

00230 
00231     def assertAfterWithGeneratorInvariantsWithError(self, mock_generator):
00232         self.assertTrue(mock_generator.yielded)
00233         self.assertTrue(mock_generator.stopped)
00234 

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_with.ContextmanagerAssertionMixin.assertAfterWithManagerInvariants (   self,
  mock_manager,
  exit_args 
) [inherited]

Definition at line 198 of file test_with.py.

00198 
00199     def assertAfterWithManagerInvariants(self, mock_manager, exit_args):
00200         self.assertTrue(mock_manager.enter_called)
00201         self.assertTrue(mock_manager.exit_called)
00202         self.assertEqual(mock_manager.exit_args, exit_args)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 203 of file test_with.py.

00203 
00204     def assertAfterWithManagerInvariantsNoError(self, mock_manager):
00205         self.assertAfterWithManagerInvariants(mock_manager,
00206             (None, None, None))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_with.ContextmanagerAssertionMixin.assertAfterWithManagerInvariantsWithError (   self,
  mock_manager,
  exc_type = None 
) [inherited]

Definition at line 219 of file test_with.py.

00219 
00220                                                   exc_type=None):
00221         self.assertTrue(mock_manager.enter_called)
00222         self.assertTrue(mock_manager.exit_called)
00223         if exc_type is None:
00224             self.assertEqual(mock_manager.exit_args[1], self.TEST_EXCEPTION)
00225             exc_type = type(self.TEST_EXCEPTION)
00226         self.assertEqual(mock_manager.exit_args[0], exc_type)
00227         # Test the __exit__ arguments. Issue #7853
00228         self.assertIsInstance(mock_manager.exit_args[1], exc_type)
00229         self.assertIsNot(mock_manager.exit_args[2], None)

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_with.ContextmanagerAssertionMixin.assertInWithGeneratorInvariants (   self,
  mock_generator 
) [inherited]

Definition at line 207 of file test_with.py.

00207 
00208     def assertInWithGeneratorInvariants(self, mock_generator):
00209         self.assertTrue(mock_generator.yielded)
00210         self.assertFalse(mock_generator.stopped)

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_with.ContextmanagerAssertionMixin.assertInWithManagerInvariants (   self,
  mock_manager 
) [inherited]

Definition at line 193 of file test_with.py.

00193 
00194     def assertInWithManagerInvariants(self, mock_manager):
00195         self.assertTrue(mock_manager.enter_called)
00196         self.assertFalse(mock_manager.exit_called)
00197         self.assertEqual(mock_manager.exit_args, None)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 215 of file test_with.py.

00215 
00216     def raiseTestException(self):
00217         raise self.TEST_EXCEPTION

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 190 of file test_with.py.

00190 
00191     def setUp(self):
00192         self.TEST_EXCEPTION = RuntimeError("test exception")

Here is the caller graph for this function:

Definition at line 340 of file test_with.py.

Here is the call graph for this function:

Definition at line 325 of file test_with.py.

Here is the call graph for this function:

Definition at line 310 of file test_with.py.

00310 
00311     def testSingleArgBoundToMultipleElementTupleError(self):
00312         def shouldThrowValueError():
00313             with Nested(mock_contextmanager_generator()) as (foo, bar):
00314                 pass
00315         self.assertRaises(ValueError, shouldThrowValueError)

Here is the call graph for this function:

Definition at line 294 of file test_with.py.

00294 
00295     def testSingleArgBoundToNonTuple(self):
00296         m = mock_contextmanager_generator()
00297         # This will bind all the arguments to nested() into a single list
00298         # assigned to foo.
00299         with Nested(m) as foo:
00300             self.assertInWithManagerInvariants(m)
00301         self.assertAfterWithManagerInvariantsNoError(m)

Here is the call graph for this function:

Definition at line 302 of file test_with.py.

00302 
00303     def testSingleArgBoundToSingleElementParenthesizedList(self):
00304         m = mock_contextmanager_generator()
00305         # This will bind all the arguments to nested() into a single list
00306         # assigned to foo.
00307         with Nested(m) as (foo):
00308             self.assertInWithManagerInvariants(m)
00309         self.assertAfterWithManagerInvariantsNoError(m)

Here is the call graph for this function:

Definition at line 290 of file test_with.py.

Here is the call graph for this function:

Definition at line 316 of file test_with.py.

00316 
00317     def testSingleArgUnbound(self):
00318         mock_contextmanager = mock_contextmanager_generator()
00319         mock_nested = MockNested(mock_contextmanager)
00320         with mock_nested:
00321             self.assertInWithManagerInvariants(mock_contextmanager)
00322             self.assertInWithManagerInvariants(mock_nested)
00323         self.assertAfterWithManagerInvariantsNoError(mock_contextmanager)
00324         self.assertAfterWithManagerInvariantsNoError(mock_nested)

Here is the call graph for this function:


Member Data Documentation

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 191 of file test_with.py.


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