blob: ec54f1e1db176a2d993f6d5fb47f1bd2b9d8b316 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
2# SPDX-License-Identifier: MIT
3#
4
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005from oeqa.runtime.case import OERuntimeTestCase
6from oeqa.core.decorator.depends import OETestDepends
Brad Bishop977dc1a2019-02-06 16:01:43 -05007from oeqa.runtime.decorator.package import OEHasPackage
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008
9class PythonTest(OERuntimeTestCase):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080010 @OETestDepends(['ssh.SSHTest.test_ssh'])
Brad Bishop977dc1a2019-02-06 16:01:43 -050011 @OEHasPackage(['python3-core'])
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080012 def test_python3(self):
13 cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
14 status, output = self.target.run(cmd)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050015 msg = 'Exit status was not 0. Output: %s' % output
16 self.assertEqual(status, 0, msg=msg)
17
18 msg = 'Incorrect output: %s' % output
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019 self.assertEqual(output, "Hello, world", msg=msg)