summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk/cases/python.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/python.py')
-rw-r--r--meta/lib/oeqa/sdk/cases/python.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/meta/lib/oeqa/sdk/cases/python.py b/meta/lib/oeqa/sdk/cases/python.py
index a334abce5f..b990cd889a 100644
--- a/meta/lib/oeqa/sdk/cases/python.py
+++ b/meta/lib/oeqa/sdk/cases/python.py
@@ -1,29 +1,17 @@
1# 1#
2# Copyright OpenEmbedded Contributors
3#
2# SPDX-License-Identifier: MIT 4# SPDX-License-Identifier: MIT
3# 5#
4 6
5import subprocess, unittest
6from oeqa.sdk.case import OESDKTestCase 7from oeqa.sdk.case import OESDKTestCase
7 8
8from oeqa.utils.subprocesstweak import errors_have_output 9from oeqa.utils.subprocesstweak import errors_have_output
9errors_have_output() 10errors_have_output()
10 11
11class Python2Test(OESDKTestCase):
12 def setUp(self):
13 if not (self.tc.hasHostPackage("nativesdk-python-core") or
14 self.tc.hasHostPackage("python-core-native")):
15 raise unittest.SkipTest("No python package in the SDK")
16
17 def test_python2(self):
18 cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
19 output = self._run(cmd)
20 self.assertEqual(output, "Hello, world\n")
21
22class Python3Test(OESDKTestCase): 12class Python3Test(OESDKTestCase):
23 def setUp(self): 13 def setUp(self):
24 if not (self.tc.hasHostPackage("nativesdk-python3-core") or 14 self.ensure_host_package("python3-core", recipe="python3")
25 self.tc.hasHostPackage("python3-core-native")):
26 raise unittest.SkipTest("No python3 package in the SDK")
27 15
28 def test_python3(self): 16 def test_python3(self):
29 cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" 17 cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""