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.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/meta/lib/oeqa/sdk/cases/python.py b/meta/lib/oeqa/sdk/cases/python.py
index 2254867d45..b9174fadba 100644
--- a/meta/lib/oeqa/sdk/cases/python.py
+++ b/meta/lib/oeqa/sdk/cases/python.py
@@ -1,6 +1,9 @@
1import subprocess, unittest 1import subprocess, unittest
2from oeqa.sdk.case import OESDKTestCase 2from oeqa.sdk.case import OESDKTestCase
3 3
4from oeqa.utils.subprocesstweak import errors_have_output
5errors_have_output()
6
4class Python2Test(OESDKTestCase): 7class Python2Test(OESDKTestCase):
5 def setUp(self): 8 def setUp(self):
6 if not (self.tc.hasHostPackage("nativesdk-python-core") or 9 if not (self.tc.hasHostPackage("nativesdk-python-core") or
@@ -8,12 +11,9 @@ class Python2Test(OESDKTestCase):
8 raise unittest.SkipTest("No python package in the SDK") 11 raise unittest.SkipTest("No python package in the SDK")
9 12
10 def test_python2(self): 13 def test_python2(self):
11 try: 14 cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
12 cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" 15 output = self._run(cmd)
13 output = self._run(cmd) 16 self.assertEqual(output, "Hello, world\n")
14 self.assertEqual(output, "Hello, world\n")
15 except subprocess.CalledProcessError as e:
16 self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output))
17 17
18class Python3Test(OESDKTestCase): 18class Python3Test(OESDKTestCase):
19 def setUp(self): 19 def setUp(self):
@@ -22,9 +22,6 @@ class Python3Test(OESDKTestCase):
22 raise unittest.SkipTest("No python3 package in the SDK") 22 raise unittest.SkipTest("No python3 package in the SDK")
23 23
24 def test_python3(self): 24 def test_python3(self):
25 try: 25 cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
26 cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" 26 output = self._run(cmd)
27 output = self._run(cmd) 27 self.assertEqual(output, "Hello, world\n")
28 self.assertEqual(output, "Hello, world\n")
29 except subprocess.CalledProcessError as e:
30 self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output))