blob: 4419a9f639470cd10db7a9f22396fbfbc404f809 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.core.decorator.depends import OETestDepends
3from oeqa.core.decorator.oeid import OETestID
Brad Bishop6e60e8b2018-02-01 10:27:11 -05004
5class PythonTest(OERuntimeTestCase):
Brad Bishop6e60e8b2018-02-01 10:27:11 -05006 @classmethod
7 def setUpClass(cls):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08008 import unittest
9 if "python3-core" not in cls.tc.image_packages:
10 raise unittest.SkipTest("Python3 not on target")
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011
12 @OETestID(965)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080013 @OETestDepends(['ssh.SSHTest.test_ssh'])
14 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)