mirror of
https://github.com/clearml/wexpect-venv
synced 2025-01-31 02:46:59 +00:00
[ADD][TST] interact dead; [FIX] add workaround of unreachable codecov
This commit is contained in:
parent
2e6ac6bc1f
commit
9e26c67324
@ -21,7 +21,8 @@ test_script:
|
||||
|
||||
after_test:
|
||||
# Upload code coverage results.
|
||||
- codecov
|
||||
# https://github.com/codecov/codecov-python/issues/158#issuecomment-514282362
|
||||
- codecov --required || (sleep 5 && codecov --required) || (sleep 5 && codecov --required) || (sleep 5 && codecov --required) || (sleep 5 && codecov --required)
|
||||
|
||||
# fill .pypirc file.
|
||||
# pypi
|
||||
|
@ -33,7 +33,7 @@ import unittest
|
||||
from . import PexpectTestCase
|
||||
|
||||
class InteractTestCase(PexpectTestCase.PexpectTestCase):
|
||||
def testPath(self):
|
||||
def test_interact(self):
|
||||
# Path of cmd executable:
|
||||
cmd_exe = 'cmd'
|
||||
cmdPrompt = '>'
|
||||
@ -55,6 +55,23 @@ class InteractTestCase(PexpectTestCase.PexpectTestCase):
|
||||
|
||||
self.assertEqual('hello', p.before.splitlines()[1])
|
||||
|
||||
def test_interact_dead(self):
|
||||
# Path of cmd executable:
|
||||
echo = 'echo hello'
|
||||
|
||||
# Start the child process
|
||||
p = wexpect.spawn(echo)
|
||||
|
||||
p.expect('hello')
|
||||
time.sleep(0.5)
|
||||
|
||||
|
||||
with self.assertRaises(wexpect.ExceptionPexpect):
|
||||
p.interact()
|
||||
|
||||
with self.assertRaises(wexpect.ExceptionPexpect):
|
||||
p.stop_interact()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user