summaryrefslogtreecommitdiffstats
path: root/support/testing/tests/package/sample_python_argh.py
diff options
context:
space:
mode:
authorRicardo Martincoski <ricardo.martincoski@gmail.com>2018-11-16 01:57:21 -0200
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>2018-11-23 22:05:46 +0100
commit1bd9e9c199a334a035e9b4690135fdaf849b3d76 (patch)
tree26fb82c6940ae31e1da9f2e7a7a077b6e6a81663 /support/testing/tests/package/sample_python_argh.py
parent0d896cf007920e01fc9104f98c8f4d3734a6f245 (diff)
downloadbuildroot-1bd9e9c199a334a035e9b4690135fdaf849b3d76.tar.gz
buildroot-1bd9e9c199a334a035e9b4690135fdaf849b3d76.zip
support/testing: add python-argh tests
Use a simple script to check the basic usage. Since this package provides command line arguments, override run_sample_scripts to call the script with arguments and check the expected output. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'support/testing/tests/package/sample_python_argh.py')
-rw-r--r--support/testing/tests/package/sample_python_argh.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/support/testing/tests/package/sample_python_argh.py b/support/testing/tests/package/sample_python_argh.py
new file mode 100644
index 0000000000..48247bf604
--- /dev/null
+++ b/support/testing/tests/package/sample_python_argh.py
@@ -0,0 +1,10 @@
+import argh
+
+
+@argh.arg("foo", help="help for foo")
+@argh.arg("--bar", help="help for bar")
+def main(foo, bar=False):
+ print("{}, {}".format(foo, bar))
+
+
+argh.dispatch_command(main)
OpenPOWER on IntegriCloud