+ added more tests

* fixed chdir home bug
* fixed some tests creating normal data dir
This commit is contained in:
Kevin Froman 2020-03-04 00:59:29 -06:00
parent 665cb0c732
commit 60d2ebfaed
20 changed files with 139 additions and 55 deletions

View file

@ -7,10 +7,13 @@ TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
os.environ["ONIONR_HOME"] = TEST_DIR
print(f'running integration test for {__file__}')
with Popen(['./onionr.sh'], stdout=PIPE) as onionr_proc:
output = onionr_proc.stdout.read().decode()
if onionr_proc.returncode != 0:
raise ValueError('Raised non zero exit ' + str(onionr_proc.returncode))
try:
with Popen(['./onionr.sh'], stdout=PIPE) as onionr_proc:
output = onionr_proc.stdout.read().decode()
except SystemExit:
pass
if onionr_proc.returncode != 10:
raise ValueError('Raised non 10 exit ' + str(onionr_proc.returncode))
if output != '':
if 'Run with --help to see available commands' not in output:
raise ValueError('No command run returned non-blank output')