mirror of
https://github.com/clearml/wexpect-venv
synced 2025-02-07 13:30:56 +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:
|
after_test:
|
||||||
# Upload code coverage results.
|
# 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.
|
# fill .pypirc file.
|
||||||
# pypi
|
# pypi
|
||||||
|
@ -33,7 +33,7 @@ import unittest
|
|||||||
from . import PexpectTestCase
|
from . import PexpectTestCase
|
||||||
|
|
||||||
class InteractTestCase(PexpectTestCase.PexpectTestCase):
|
class InteractTestCase(PexpectTestCase.PexpectTestCase):
|
||||||
def testPath(self):
|
def test_interact(self):
|
||||||
# Path of cmd executable:
|
# Path of cmd executable:
|
||||||
cmd_exe = 'cmd'
|
cmd_exe = 'cmd'
|
||||||
cmdPrompt = '>'
|
cmdPrompt = '>'
|
||||||
@ -55,6 +55,23 @@ class InteractTestCase(PexpectTestCase.PexpectTestCase):
|
|||||||
|
|
||||||
self.assertEqual('hello', p.before.splitlines()[1])
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user