Back to index

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

List of all members.

Public Member Functions

def setUp
def tearDown
def with_spaces
def test_shell_string_with_spaces
def test_shell_sequence_with_spaces
def test_noshell_string_with_spaces
def test_noshell_sequence_with_spaces
def assertStderrEqual

Public Attributes

 fname

Detailed Description

Definition at line 1583 of file test_subprocess.py.


Member Function Documentation

def test.test_subprocess.BaseTestCase.assertStderrEqual (   self,
  stderr,
  expected,
  msg = None 
) [inherited]

Definition at line 56 of file test_subprocess.py.

00056 
00057     def assertStderrEqual(self, stderr, expected, msg=None):
00058         # In a debug build, stuff like "[6580 refs]" is printed to stderr at
00059         # shutdown time.  That frustrates tests trying to check stderr produced
00060         # from a spawned Python process.
00061         actual = support.strip_python_stderr(stderr)
00062         self.assertEqual(actual, expected, msg)
00063 

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from test.test_subprocess.BaseTestCase.

Definition at line 1585 of file test_subprocess.py.

01585 
01586     def setUp(self):
01587         super().setUp()
01588         f, fname = mkstemp(".py", "te st")
01589         self.fname = fname.lower ()
01590         os.write(f, b"import sys;"
01591                     b"sys.stdout.write('%d %s' % (len(sys.argv), [a.lower () for a in sys.argv]))"
01592         )
01593         os.close(f)

Here is the caller graph for this function:

Reimplemented from test.test_subprocess.BaseTestCase.

Definition at line 1594 of file test_subprocess.py.

01594 
01595     def tearDown(self):
01596         os.remove(self.fname)
01597         super().tearDown()

Here is the caller graph for this function:

Definition at line 1621 of file test_subprocess.py.

01621 
01622     def test_noshell_sequence_with_spaces(self):
01623         # call() function with sequence argument with spaces on Windows
01624         self.with_spaces([sys.executable, self.fname, "ab cd"])
01625 

Here is the call graph for this function:

Definition at line 1616 of file test_subprocess.py.

01616 
01617     def test_noshell_string_with_spaces(self):
01618         # call() function with string argument with spaces on Windows
01619         self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
01620                              "ab cd"))

Here is the call graph for this function:

Definition at line 1612 of file test_subprocess.py.

01612 
01613     def test_shell_sequence_with_spaces(self):
01614         # call() function with sequence argument with spaces on Windows
01615         self.with_spaces([sys.executable, self.fname, "ab cd"], shell=1)

Here is the call graph for this function:

Definition at line 1607 of file test_subprocess.py.

01607 
01608     def test_shell_string_with_spaces(self):
01609         # call() function with string argument with spaces on Windows
01610         self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
01611                                              "ab cd"), shell=1)

Here is the call graph for this function:

def test.test_subprocess.CommandsWithSpaces.with_spaces (   self,
  args,
  kwargs 
)

Definition at line 1598 of file test_subprocess.py.

01598 
01599     def with_spaces(self, *args, **kwargs):
01600         kwargs['stdout'] = subprocess.PIPE
01601         p = subprocess.Popen(*args, **kwargs)
01602         self.addCleanup(p.stdout.close)
01603         self.assertEqual(
01604           p.stdout.read ().decode("mbcs"),
01605           "2 [%r, 'ab cd']" % self.fname
01606         )

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1588 of file test_subprocess.py.


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