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)
def test_run_other_wd(self): self.assertEqual(tempfile.gettempdir(), run('pwd', True, cwd=tempfile.gettempdir()).strip())
def test_run(self): self.assertEqual(self.tempd, run('pwd', True).strip())