add a test to test the whole command tool

This commit is contained in:
lilydjwg 2022-02-04 16:53:26 +08:00
parent ac1aafc9f1
commit d5920efa54

21
tests/test_simplerun.py Normal file
View File

@ -0,0 +1,21 @@
# MIT licensed
# Copyright (c) 2022 lilydjwg <lilydjwg@gmail.com>, et al.
import sys
import tempfile
import subprocess
def test_simple_run():
'''make sure the tool as a whole can run the simplest check'''
with tempfile.NamedTemporaryFile(mode='w') as f:
f.write('''\
[t]
source = "cmd"
cmd = "echo 1"
''')
f.flush()
subprocess.check_call([
sys.executable, '-m', 'nvchecker',
'-c', f.name,
])