From 0b3d2a354960b2a9138a230929da3df057b680cb Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Sat, 12 Sep 2015 12:06:03 +0100 Subject: Revert some changes to Popen tests ~ is a shell feature, so running ls ~ without a shell fails. --- tests/test_popen_spawn.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_popen_spawn.py b/tests/test_popen_spawn.py index 740b510..98046ed 100644 --- a/tests/test_popen_spawn.py +++ b/tests/test_popen_spawn.py @@ -52,9 +52,9 @@ class ExpectTestCase (PexpectTestCase.PexpectTestCase): p.expect_exact(pexpect.EOF) def test_expect(self): - the_old_way = subprocess.Popen(args=['ls', '-l', '~'], + the_old_way = subprocess.Popen(args=['ls', '-l', '/bin'], stdout=subprocess.PIPE).communicate()[0].rstrip() - p = PopenSpawn('ls -l ~') + p = PopenSpawn('ls -l /bin') the_new_way = b'' while 1: i = p.expect([b'\n', pexpect.EOF]) @@ -66,9 +66,9 @@ class ExpectTestCase (PexpectTestCase.PexpectTestCase): assert the_old_way == the_new_way, len(the_old_way) - len(the_new_way) def test_expect_exact(self): - the_old_way = subprocess.Popen(args=['ls', '-l', '~'], + the_old_way = subprocess.Popen(args=['ls', '-l', '/bin'], stdout=subprocess.PIPE).communicate()[0].rstrip() - p = PopenSpawn('ls -l ~') + p = PopenSpawn('ls -l /bin') the_new_way = b'' while 1: i = p.expect_exact([b'\n', pexpect.EOF]) @@ -85,9 +85,9 @@ class ExpectTestCase (PexpectTestCase.PexpectTestCase): self.assertEqual(p.after, b'.?') def test_expect_eof(self): - the_old_way = subprocess.Popen(args=['ls', '-l', '~'], + the_old_way = subprocess.Popen(args=['ls', '-l', '/bin'], stdout=subprocess.PIPE).communicate()[0].rstrip() - p = PopenSpawn('ls -l ~') + p = PopenSpawn('ls -l /bin') # This basically tells it to read everything. Same as pexpect.run() # function. p.expect(pexpect.EOF) @@ -100,7 +100,7 @@ class ExpectTestCase (PexpectTestCase.PexpectTestCase): self.assertEqual(p.after, pexpect.TIMEOUT) def test_unexpected_eof(self): - p = PopenSpawn('ls -l ~') + p = PopenSpawn('ls -l /bin') try: p.expect('_Z_XY_XZ') # Probably never see this in ls output. except pexpect.EOF: -- cgit v1.2.1