2018-04-10 18:06:42 +00:00
|
|
|
from minitor.main import call_output
|
|
|
|
|
|
|
|
|
|
|
|
class TestMinitor(object):
|
|
|
|
|
|
|
|
def test_call_output(self):
|
|
|
|
# valid command should have result and no exception
|
|
|
|
output, ex = call_output(['echo', 'test'])
|
|
|
|
assert output == b'test'
|
|
|
|
assert ex is None
|
|
|
|
|
|
|
|
output, ex = call_output(['ls', '--not-a-real-flag'])
|
2018-04-11 17:03:05 +00:00
|
|
|
assert output.startswith(b'ls: ')
|
2018-04-10 18:06:42 +00:00
|
|
|
assert ex is not None
|