blob: 5ea992b9f332bb6dc2a7841d1e6782a7a7699120 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
Patrick Williams92b42cb2022-09-03 06:53:57 -05002# Copyright OpenEmbedded Contributors
3#
Brad Bishopc342db32019-05-15 21:57:59 -04004# SPDX-License-Identifier: MIT
5#
6
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08007import subprocess, unittest
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008from oeqa.sdk.case import OESDKTestCase
9
Brad Bishop19323692019-04-05 15:28:33 -040010from oeqa.utils.subprocesstweak import errors_have_output
11errors_have_output()
12
Brad Bishop19323692019-04-05 15:28:33 -040013class Python3Test(OESDKTestCase):
14 def setUp(self):
15 if not (self.tc.hasHostPackage("nativesdk-python3-core") or
16 self.tc.hasHostPackage("python3-core-native")):
17 raise unittest.SkipTest("No python3 package in the SDK")
18
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019 def test_python3(self):
Brad Bishop19323692019-04-05 15:28:33 -040020 cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
21 output = self._run(cmd)
22 self.assertEqual(output, "Hello, world\n")