From d5920efa5411041942625c9e4e4b6407502087b6 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Fri, 4 Feb 2022 16:53:26 +0800 Subject: [PATCH] add a test to test the whole command tool --- tests/test_simplerun.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/test_simplerun.py diff --git a/tests/test_simplerun.py b/tests/test_simplerun.py new file mode 100644 index 0000000..fb19b9a --- /dev/null +++ b/tests/test_simplerun.py @@ -0,0 +1,21 @@ +# MIT licensed +# Copyright (c) 2022 lilydjwg , 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, + ]) +