summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2015-09-12 12:06:03 +0100
committerThomas Kluyver <takowl@gmail.com>2015-09-12 12:06:03 +0100
commit0b3d2a354960b2a9138a230929da3df057b680cb (patch)
tree20788f9c2928d7a5f161fad17a6a92eaacc5afc8
parentcd9296c1b93bcdd1006cd044110c3e806c322a66 (diff)
downloadpexpect-git-0b3d2a354960b2a9138a230929da3df057b680cb.tar.gz
Revert some changes to Popen tests
~ is a shell feature, so running ls ~ without a shell fails.
-rw-r--r--tests/test_popen_spawn.py14
1 files 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: