mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
add a test to test the whole command tool
This commit is contained in:
parent
ac1aafc9f1
commit
d5920efa54
1 changed files with 21 additions and 0 deletions
21
tests/test_simplerun.py
Normal file
21
tests/test_simplerun.py
Normal 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,
|
||||||
|
])
|
||||||
|
|
Loading…
Add table
Reference in a new issue