Browse Source

support/testing: add new test for python-botocore

Add a rudimentary test inspired from the "Using botocore" section in
the package README ([1]).

Note that it doesn't try to use the instantiated client, as this would
require a network connection when the test runs.

[1]: https://github.com/boto/botocore

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Raphaël Mélotte 3 years ago
parent
commit
9060f1a6b8

+ 3 - 0
support/testing/tests/package/sample_python_botocore.py

@@ -0,0 +1,3 @@
+import botocore.session
+session = botocore.session.get_session()
+client = session.create_client('ec2', region_name="us-east-1")

+ 12 - 0
support/testing/tests/package/test_python_botocore.py

@@ -0,0 +1,12 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3Botocore(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_BOTOCORE=y
+        """
+    sample_scripts = ["tests/package/sample_python_botocore.py"]
+    timeout = 10