diff options
author | Thomas Kluyver <thomas@kluyver.me.uk> | 2017-08-22 14:56:46 +0100 |
---|---|---|
committer | Thomas Kluyver <thomas@kluyver.me.uk> | 2017-08-22 14:56:46 +0100 |
commit | e276c17250516ff5a3deca924e35fd3fa68957d9 (patch) | |
tree | d98167086ddc11b8e4d67aaae50cce143eaeba64 /tests | |
parent | 8b4974f333f2d41b47a67c94c4c445a274d8ddd4 (diff) | |
parent | 964e03d4f63ecb045832cac9938be56feaeba46c (diff) | |
download | pexpect-git-e276c17250516ff5a3deca924e35fd3fa68957d9.tar.gz |
Merge branch 'master' of github.com:pexpect/pexpect
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_async.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/test_async.py b/tests/test_async.py index 1a15524..1cc3236 100644 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -18,53 +18,53 @@ class AsyncTests(PexpectTestCase): def test_simple_expect(self): p = pexpect.spawn('cat') p.sendline('Hello asyncio') - coro = p.expect(['Hello', pexpect.EOF] , async=True) + coro = p.expect(['Hello', pexpect.EOF] , async_=True) assert run(coro) == 0 print('Done') def test_timeout(self): p = pexpect.spawn('cat') - coro = p.expect('foo', timeout=1, async=True) + coro = p.expect('foo', timeout=1, async_=True) with self.assertRaises(pexpect.TIMEOUT): run(coro) p = pexpect.spawn('cat') - coro = p.expect(['foo', pexpect.TIMEOUT], timeout=1, async=True) + coro = p.expect(['foo', pexpect.TIMEOUT], timeout=1, async_=True) assert run(coro) == 1 def test_eof(self): p = pexpect.spawn('cat') p.sendline('Hi') - coro = p.expect(pexpect.EOF, async=True) + coro = p.expect(pexpect.EOF, async_=True) p.sendeof() assert run(coro) == 0 p = pexpect.spawn('cat') p.sendeof() - coro = p.expect('Blah', async=True) + coro = p.expect('Blah', async_=True) with self.assertRaises(pexpect.EOF): run(coro) def test_expect_exact(self): p = pexpect.spawn('%s list100.py' % sys.executable) - assert run(p.expect_exact(b'5', async=True)) == 0 - assert run(p.expect_exact(['wpeok', b'11'], async=True)) == 1 - assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 + assert run(p.expect_exact(b'5', async_=True)) == 0 + assert run(p.expect_exact(['wpeok', b'11'], async_=True)) == 1 + assert run(p.expect_exact([b'foo', pexpect.EOF], async_=True)) == 1 def test_async_utf8(self): p = pexpect.spawn('%s list100.py' % sys.executable, encoding='utf8') - assert run(p.expect_exact(u'5', async=True)) == 0 - assert run(p.expect_exact([u'wpeok', u'11'], async=True)) == 1 - assert run(p.expect_exact([u'foo', pexpect.EOF], async=True)) == 1 + assert run(p.expect_exact(u'5', async_=True)) == 0 + assert run(p.expect_exact([u'wpeok', u'11'], async_=True)) == 1 + assert run(p.expect_exact([u'foo', pexpect.EOF], async_=True)) == 1 def test_async_and_gc(self): p = pexpect.spawn('%s sleep_for.py 1' % sys.executable, encoding='utf8') - assert run(p.expect_exact(u'READY', async=True)) == 0 + assert run(p.expect_exact(u'READY', async_=True)) == 0 gc.collect() - assert run(p.expect_exact(u'END', async=True)) == 0 + assert run(p.expect_exact(u'END', async_=True)) == 0 def test_async_and_sync(self): p = pexpect.spawn('echo 1234', encoding='utf8', maxread=1) - assert run(p.expect_exact(u'1', async=True)) == 0 + assert run(p.expect_exact(u'1', async_=True)) == 0 assert p.expect_exact(u'2') == 0 - assert run(p.expect_exact(u'3', async=True)) == 0 + assert run(p.expect_exact(u'3', async_=True)) == 0 |