HelloWorld/tests/test_unit.py
2018-11-05 15:35:32 -06:00

16 lines
355 B
Python

import os
import re
import shutil
def checkOutput(output):
for line in output.split('\n'):
if line == 'Hello world!': return True
return False
def test_c():
print(os.getcwd())
fh = os.popen("./helloworld", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and checkOutput(output)