Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
test.test_argparse.TestArgumentsFromFile Class Reference
Inheritance diagram for test.test_argparse.TestArgumentsFromFile:
Inheritance graph
Collaboration diagram for test.test_argparse.TestArgumentsFromFile:
Collaboration graph

List of all members.

Public Member Functions

def setUp
def tearDown
def create_readonly_file

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

tuple parser_signature = Sig(fromfile_prefix_chars='@')
list argument_signatures
list failures = ['', '-b', 'X', '@invalid', '@missing']
list successes

Detailed Description

Test reading arguments from a file

Definition at line 1343 of file

Member Function Documentation

def test.test_argparse.TempDirMixin.create_readonly_file (   self,
) [inherited]

Definition at line 51 of file

00052     def create_readonly_file(self, filename):
00053         file_path = os.path.join(self.temp_dir, filename)
00054         with open(file_path, 'w') as file:
00055             file.write(filename)
00056         os.chmod(file_path, stat.S_IREAD)

Here is the caller graph for this function:

Reimplemented from test.test_argparse.TempDirMixin.

Definition at line 1346 of file

01347     def setUp(self):
01348         super(TestArgumentsFromFile, self).setUp()
01349         file_texts = [
01350             ('hello', 'hello world!\n'),
01351             ('recursive', '-a\n'
01352                           'A\n'
01353                           '@hello'),
01354             ('invalid', '@no-such-path\n'),
01355         ]
01356         for path, text in file_texts:
01357             file = open(path, 'w')
01358             file.write(text)
01359             file.close()

Here is the caller graph for this function:

def test.test_argparse.TempDirMixin.tearDown (   self) [inherited]

Definition at line 47 of file

00048     def tearDown(self):
00049         os.chdir(self.old_dir)
00050         shutil.rmtree(self.temp_dir, True)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Initial value:
        Sig('y', nargs='+'),

Definition at line 1361 of file

list test.test_argparse.TestArgumentsFromFile.failures = ['', '-b', 'X', '@invalid', '@missing'] [static]

Definition at line 1366 of file

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 44 of file

tuple test.test_argparse.TestArgumentsFromFile.parser_signature = Sig(fromfile_prefix_chars='@') [static]

Definition at line 1360 of file

Initial value:
        ('X Y', NS(a=None, x='X', y=['Y'])),
        ('X -a A Y Z', NS(a='A', x='X', y=['Y', 'Z'])),
        ('@hello X', NS(a=None, x='hello world!', y=['X'])),
        ('X @hello', NS(a=None, x='X', y=['hello world!'])),
        ('-a B @recursive Y Z', NS(a='A', x='hello world!', y=['Y', 'Z'])),
        ('X @recursive Z -a B', NS(a='B', x='X', y=['hello world!', 'Z'])),

Definition at line 1367 of file

Definition at line 43 of file

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