Back to index

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

List of all members.

Public Member Functions

def test_nongroup_first
def test_group_first
def test_interleaved_groups
def assertEqual
def setUp

Detailed Description

Tests that order of group positionals matches construction order

Definition at line 2007 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 2020 of file test_argparse.py.

02020 
02021     def test_group_first(self):
02022         parser = ErrorRaisingArgumentParser()
02023         group = parser.add_argument_group('xxx')
02024         group.add_argument('foo')
02025         parser.add_argument('bar')
02026         parser.add_argument('baz')
02027         expected = NS(foo='1', bar='2', baz='3')
02028         result = parser.parse_args('1 2 3'.split())
02029         self.assertEqual(expected, result)

Here is the call graph for this function:

Definition at line 2030 of file test_argparse.py.

02030 
02031     def test_interleaved_groups(self):
02032         parser = ErrorRaisingArgumentParser()
02033         group = parser.add_argument_group('xxx')
02034         parser.add_argument('foo')
02035         group.add_argument('bar')
02036         parser.add_argument('baz')
02037         group = parser.add_argument_group('yyy')
02038         group.add_argument('frell')
02039         expected = NS(foo='1', bar='2', baz='3', frell='4')
02040         result = parser.parse_args('1 2 3 4'.split())
02041         self.assertEqual(expected, result)
02042 
02043 # ===================
02044 # Parent parser tests
02045 # ===================

Here is the call graph for this function:

Definition at line 2010 of file test_argparse.py.

02010 
02011     def test_nongroup_first(self):
02012         parser = ErrorRaisingArgumentParser()
02013         parser.add_argument('foo')
02014         group = parser.add_argument_group('g')
02015         group.add_argument('bar')
02016         parser.add_argument('baz')
02017         expected = NS(foo='1', bar='2', baz='3')
02018         result = parser.parse_args('1 2 3'.split())
02019         self.assertEqual(expected, result)

Here is the call graph for this function:


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