1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2026-02-23 11:15:57 +00:00
Files
operating-system/buildroot/support/testing/tests/package/test_python_click.py
Pascal Vizeli 41d3f59002 Update Buildroot to 2019.02.3 (#415)
* Update Buildroot to 2019-02.3

* Fix enter script

* Update ova_defconfig

* Fix network manager

* Remove runc patches

* Use same docker version

* Fix build

* Fix vmtools

* Fix depens

* Fix handling with tempfiles

* Fix permission handling

* Fix cp

* Cleanup

* Fix mounts
2019-06-27 11:58:50 +02:00

45 lines
1.4 KiB
Python

from tests.package.test_python import TestPythonPackageBase
class TestPythonClick(TestPythonPackageBase):
sample_scripts = ["tests/package/sample_python_click.py"]
def run_sample_scripts(self):
cmd = self.interpreter + " sample_python_click.py --help"
output, exit_code = self.emulator.run(cmd)
self.assertIn("Usage:", output[0])
self.assertEqual(exit_code, 0)
cmd = self.interpreter + " sample_python_click.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_click.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_click.py"
output, exit_code = self.emulator.run(cmd)
self.assertIn("Usage:", output[0])
self.assertEqual(exit_code, 2)
class TestPythonPy2Click(TestPythonClick):
__test__ = True
config = TestPythonClick.config + \
"""
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_CLICK=y
"""
class TestPythonPy3Click(TestPythonClick):
__test__ = True
config = TestPythonClick.config + \
"""
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_CLICK=y
"""