(self)
| 52 | p.expect_exact(pexpect.EOF) |
| 53 | |
| 54 | def test_expect(self): |
| 55 | the_old_way = subprocess.Popen(args=['ls', '-l', '/bin'], |
| 56 | stdout=subprocess.PIPE).communicate()[0].rstrip() |
| 57 | p = PopenSpawn('ls -l /bin') |
| 58 | the_new_way = b'' |
| 59 | while 1: |
| 60 | i = p.expect([b'\n', pexpect.EOF]) |
| 61 | the_new_way = the_new_way + p.before |
| 62 | if i == 1: |
| 63 | break |
| 64 | the_new_way += b'\n' |
| 65 | the_new_way = the_new_way.rstrip() |
| 66 | assert the_old_way == the_new_way, len(the_old_way) - len(the_new_way) |
| 67 | |
| 68 | def test_expect_exact(self): |
| 69 | the_old_way = subprocess.Popen(args=['ls', '-l', '/bin'], |
nothing calls this directly
no test coverage detected