diff options
author | Peter Korsgaard <peter@korsgaard.com> | 2018-12-02 08:15:26 +0100 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2018-12-02 08:16:10 +0100 |
commit | 13c43455a05b036002e79808ca1c8e0d91d7871b (patch) | |
tree | 147ddbfc5486085018bb527de1a43961fc8ee1ca /support/testing/tests/package/test_python_argh.py | |
parent | 2e08c7398a47b414c288ea516514adac3edf00fb (diff) | |
parent | 0393f5d34433e34e49ff7ce0fb998735453ed4fc (diff) | |
download | buildroot-13c43455a05b036002e79808ca1c8e0d91d7871b.tar.gz buildroot-13c43455a05b036002e79808ca1c8e0d91d7871b.zip |
Merge branch 'next'
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'support/testing/tests/package/test_python_argh.py')
-rw-r--r-- | support/testing/tests/package/test_python_argh.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/support/testing/tests/package/test_python_argh.py b/support/testing/tests/package/test_python_argh.py new file mode 100644 index 0000000000..de4b4cbe74 --- /dev/null +++ b/support/testing/tests/package/test_python_argh.py @@ -0,0 +1,45 @@ +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonArgh(TestPythonPackageBase): + config = TestPythonPackageBase.config + sample_scripts = ["tests/package/sample_python_argh.py"] + + def run_sample_scripts(self): + cmd = self.interpreter + " sample_python_argh.py -h" + output, exit_code = self.emulator.run(cmd) + self.assertIn("usage:", output[0]) + self.assertEqual(exit_code, 0) + + cmd = self.interpreter + " sample_python_argh.py 123" + output, exit_code = self.emulator.run(cmd) + self.assertEqual(output[0], "123, False") + self.assertEqual(exit_code, 0) + + cmd = self.interpreter + " sample_python_argh.py --bar 456" + output, exit_code = self.emulator.run(cmd) + self.assertEqual(output[0], "456, True") + self.assertEqual(exit_code, 0) + + cmd = self.interpreter + " sample_python_argh.py" + output, exit_code = self.emulator.run(cmd) + self.assertIn("usage:", output[0]) + self.assertEqual(exit_code, 2) + + +class TestPythonPy2Argh(TestPythonArgh): + __test__ = True + config = TestPythonArgh.config + \ + """ + BR2_PACKAGE_PYTHON=y + BR2_PACKAGE_PYTHON_ARGH=y + """ + + +class TestPythonPy3Argh(TestPythonArgh): + __test__ = True + config = TestPythonArgh.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_ARGH=y + """ |