Back to index

python3.2  3.2.2
Public Member Functions
test.test_argparse.TestNamespace Class Reference
Inheritance diagram for test.test_argparse.TestNamespace:
Inheritance graph
[legend]
Collaboration diagram for test.test_argparse.TestNamespace:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_constructor
def test_equality
def assertEqual
def setUp

Detailed Description

Definition at line 4374 of file test_argparse.py.


Member Function Documentation

def test.test_argparse.TestCase.assertEqual (   self,
  obj1,
  obj2 
) [inherited]

Definition at line 22 of file test_argparse.py.

00022 
00023     def assertEqual(self, obj1, obj2):
00024         if obj1 != obj2:
00025             print('')
00026             print(repr(obj1))
00027             print(repr(obj2))
00028             print(obj1)
00029             print(obj2)
00030         super(TestCase, self).assertEqual(obj1, obj2)

def test.test_argparse.TestCase.setUp (   self) [inherited]

Reimplemented in test.test_argparse.TestParentParsers, and test.test_argparse.TestAddSubparsers.

Definition at line 31 of file test_argparse.py.

00031 
00032     def setUp(self):
00033         # The tests assume that line wrapping occurs at 80 columns, but this
00034         # behaviour can be overridden by setting the COLUMNS environment
00035         # variable.  To ensure that this assumption is true, unset COLUMNS.
00036         env = support.EnvironmentVarGuard()
00037         env.unset("COLUMNS")
00038         self.addCleanup(env.__exit__)
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4376 of file test_argparse.py.

04376 
04377     def test_constructor(self):
04378         ns = argparse.Namespace()
04379         self.assertRaises(AttributeError, getattr, ns, 'x')
04380 
04381         ns = argparse.Namespace(a=42, b='spam')
04382         self.assertEqual(ns.a, 42)
04383         self.assertEqual(ns.b, 'spam')

Here is the call graph for this function:

Definition at line 4384 of file test_argparse.py.

04384 
04385     def test_equality(self):
04386         ns1 = argparse.Namespace(a=1, b=2)
04387         ns2 = argparse.Namespace(b=2, a=1)
04388         ns3 = argparse.Namespace(a=1)
04389         ns4 = argparse.Namespace(b=2)
04390 
04391         self.assertEqual(ns1, ns2)
04392         self.assertNotEqual(ns1, ns3)
04393         self.assertNotEqual(ns1, ns4)
04394         self.assertNotEqual(ns2, ns3)
04395         self.assertNotEqual(ns2, ns4)
04396         self.assertTrue(ns1 != ns3)
04397         self.assertTrue(ns1 != ns4)
04398         self.assertTrue(ns2 != ns3)
04399         self.assertTrue(ns2 != ns4)
04400 
04401 
04402 # ===================
04403 # File encoding tests
04404 # ===================

Here is the call graph for this function:


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