diff options
author | Peter Korsgaard <peter@korsgaard.com> | 2018-03-05 21:04:14 +0100 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2018-03-05 21:04:14 +0100 |
commit | 92b8bd0879e5f594d1233091437ac9a8b0c240d7 (patch) | |
tree | c0196bf0d0ad2603198f469e0eda88fe71b7abc0 /support/testing/tests/package/test_python_cryptography.py | |
parent | 528f16547689fa771bc7cb8de0885286dd439c17 (diff) | |
parent | fb4a33e586bc041a43cd415869e91d29287dcefd (diff) | |
download | buildroot-92b8bd0879e5f594d1233091437ac9a8b0c240d7.tar.gz buildroot-92b8bd0879e5f594d1233091437ac9a8b0c240d7.zip |
Merge branch 'next'
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'support/testing/tests/package/test_python_cryptography.py')
-rw-r--r-- | support/testing/tests/package/test_python_cryptography.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/support/testing/tests/package/test_python_cryptography.py b/support/testing/tests/package/test_python_cryptography.py new file mode 100644 index 0000000000..b60152de1c --- /dev/null +++ b/support/testing/tests/package/test_python_cryptography.py @@ -0,0 +1,31 @@ +import os + +from tests.package.test_python import TestPythonBase + +class TestPythonCryptography(TestPythonBase): + def fernet_test(self, timeout=-1): + cmd = self.interpreter + " -c 'from cryptography.fernet import Fernet;" + cmd += "key = Fernet.generate_key();" + cmd += "f = Fernet(key)'" + _, exit_code = self.emulator.run(cmd, timeout) + self.assertEqual(exit_code, 0) + +class TestPythonPy2Cryptography(TestPythonCryptography): + config = TestPythonBase.config + \ +""" +BR2_PACKAGE_PYTHON=y +BR2_PACKAGE_PYTHON_CRYPTOGRAPHY=y +""" + def test_run(self): + self.login() + self.fernet_test(40) + +class TestPythonPy3Cryptography(TestPythonCryptography): + config = TestPythonBase.config + \ +""" +BR2_PACKAGE_PYTHON3=y +BR2_PACKAGE_PYTHON_CRYPTOGRAPHY=y +""" + def test_run(self): + self.login() + self.fernet_test(40) |