Пример #1
0
    def test_run_no_capture(self):
        old_stdout = sys.stdout
        sys.stdout = mystdout = StringIO()

        run('pwd', True)

        out = mystdout.getvalue().split('\n')[-2]
        sys.stdout = old_stdout

        self.assertEqual(self.tempd, out)
Пример #2
0
 def test_run_other_wd(self):
     self.assertEqual(tempfile.gettempdir(),
                      run('pwd', True, cwd=tempfile.gettempdir()).strip())
Пример #3
0
 def test_run(self):
     self.assertEqual(self.tempd, run('pwd', True).strip())