blob: 5d6d133480efab7a019f4a327431779681caccf9 [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 Bishop6e60e8b2018-02-01 10:27:11 -05007from oeqa.runtime.case import OERuntimeTestCase
8from oeqa.core.decorator.depends import OETestDepends
Brad Bishop977dc1a2019-02-06 16:01:43 -05009from oeqa.runtime.decorator.package import OEHasPackage
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010
11class PythonTest(OERuntimeTestCase):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080012 @OETestDepends(['ssh.SSHTest.test_ssh'])
Brad Bishop977dc1a2019-02-06 16:01:43 -050013 @OEHasPackage(['python3-core'])
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080014 def test_python3(self):
15 cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
16 status, output = self.target.run(cmd)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017 msg = 'Exit status was not 0. Output: %s' % output
18 self.assertEqual(status, 0, msg=msg)
19
20 msg = 'Incorrect output: %s' % output
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021 self.assertEqual(output, "Hello, world", msg=msg)