blob: d43354c32a698d6c31366b0eadd9013f11f4ece1 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
2# SPDX-License-Identifier: MIT
3#
4
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005import subprocess, unittest
Brad Bishop6e60e8b2018-02-01 10:27:11 -05006from oeqa.sdk.case import OESDKTestCase
7
Brad Bishop19323692019-04-05 15:28:33 -04008from oeqa.utils.subprocesstweak import errors_have_output
9errors_have_output()
10
Brad Bishop19323692019-04-05 15:28:33 -040011class Python3Test(OESDKTestCase):
12 def setUp(self):
13 if not (self.tc.hasHostPackage("nativesdk-python3-core") or
14 self.tc.hasHostPackage("python3-core-native")):
15 raise unittest.SkipTest("No python3 package in the SDK")
16
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080017 def test_python3(self):
Brad Bishop19323692019-04-05 15:28:33 -040018 cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
19 output = self._run(cmd)
20 self.assertEqual(output, "Hello, world\n")