From 193236933b0f4ab91b1625b64e2187e2db4e0e8f Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Fri, 5 Apr 2019 15:28:33 -0400 Subject: reset upstream subtrees to HEAD Reset the following subtrees on HEAD: poky: 8217b477a1(master) meta-xilinx: 64aa3d35ae(master) meta-openembedded: 0435c9e193(master) meta-raspberrypi: 490a4441ac(master) meta-security: cb6d1c85ee(master) Squashed patches: meta-phosphor: drop systemd 239 patches meta-phosphor: mrw-api: use correct install path Change-Id: I268e2646d9174ad305630c6bbd3fbc1a6105f43d Signed-off-by: Brad Bishop --- poky/meta/lib/oeqa/sdk/cases/python.py | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'poky/meta/lib/oeqa/sdk/cases/python.py') diff --git a/poky/meta/lib/oeqa/sdk/cases/python.py b/poky/meta/lib/oeqa/sdk/cases/python.py index bd5f1f67b..b9174fadb 100644 --- a/poky/meta/lib/oeqa/sdk/cases/python.py +++ b/poky/meta/lib/oeqa/sdk/cases/python.py @@ -1,17 +1,27 @@ import subprocess, unittest from oeqa.sdk.case import OESDKTestCase -class PythonTest(OESDKTestCase): - @classmethod - def setUpClass(self): - if not (self.tc.hasHostPackage("nativesdk-python3") or - self.tc.hasHostPackage("python3-native")): +from oeqa.utils.subprocesstweak import errors_have_output +errors_have_output() + +class Python2Test(OESDKTestCase): + def setUp(self): + if not (self.tc.hasHostPackage("nativesdk-python-core") or + self.tc.hasHostPackage("python-core-native")): raise unittest.SkipTest("No python package in the SDK") + def test_python2(self): + cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" + output = self._run(cmd) + self.assertEqual(output, "Hello, world\n") + +class Python3Test(OESDKTestCase): + def setUp(self): + if not (self.tc.hasHostPackage("nativesdk-python3-core") or + self.tc.hasHostPackage("python3-core-native")): + raise unittest.SkipTest("No python3 package in the SDK") + def test_python3(self): - try: - cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" - output = self._run(cmd) - self.assertEqual(output, "Hello, world\n") - except subprocess.CalledProcessError as e: - self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output)) + cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" + output = self._run(cmd) + self.assertEqual(output, "Hello, world\n") -- cgit v1.2.3