diff mbox series

[1/5] support/testing: add new test for python-botocore

Message ID 20211024181221.2608908-1-raphael.melotte@mind.be
State Accepted
Headers show
Series [1/5] support/testing: add new test for python-botocore | expand

Commit Message

Raphaël Mélotte Oct. 24, 2021, 6:12 p.m. UTC
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>
---
 .../testing/tests/package/sample_python_botocore.py  |  3 +++
 .../testing/tests/package/test_python_botocore.py    | 12 ++++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_botocore.py
 create mode 100644 support/testing/tests/package/test_python_botocore.py

Comments

Arnout Vandecappelle Oct. 26, 2021, 7:33 p.m. UTC | #1
On 24/10/2021 20:12, Raphaël Mélotte wrote:
> 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>

  Series applied to master, thanks.

  Regards,
  Arnout

> ---
>   .../testing/tests/package/sample_python_botocore.py  |  3 +++
>   .../testing/tests/package/test_python_botocore.py    | 12 ++++++++++++
>   2 files changed, 15 insertions(+)
>   create mode 100644 support/testing/tests/package/sample_python_botocore.py
>   create mode 100644 support/testing/tests/package/test_python_botocore.py
> 
> diff --git a/support/testing/tests/package/sample_python_botocore.py b/support/testing/tests/package/sample_python_botocore.py
> new file mode 100644
> index 0000000000..cc4055989f
> --- /dev/null
> +++ b/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")
> diff --git a/support/testing/tests/package/test_python_botocore.py b/support/testing/tests/package/test_python_botocore.py
> new file mode 100644
> index 0000000000..6336c5658f
> --- /dev/null
> +++ b/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
>
diff mbox series

Patch

diff --git a/support/testing/tests/package/sample_python_botocore.py b/support/testing/tests/package/sample_python_botocore.py
new file mode 100644
index 0000000000..cc4055989f
--- /dev/null
+++ b/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")
diff --git a/support/testing/tests/package/test_python_botocore.py b/support/testing/tests/package/test_python_botocore.py
new file mode 100644
index 0000000000..6336c5658f
--- /dev/null
+++ b/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