Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | from oeqa.runtime.case import OERuntimeTestCase |
| 2 | from oeqa.core.decorator.depends import OETestDepends |
| 3 | from oeqa.core.decorator.oeid import OETestID |
Brad Bishop | 977dc1a | 2019-02-06 16:01:43 -0500 | [diff] [blame] | 4 | from oeqa.runtime.decorator.package import OEHasPackage |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 5 | |
| 6 | class PythonTest(OERuntimeTestCase): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 7 | @OETestID(965) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 8 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
Brad Bishop | 977dc1a | 2019-02-06 16:01:43 -0500 | [diff] [blame] | 9 | @OEHasPackage(['python3-core']) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 10 | def test_python3(self): |
| 11 | cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" |
| 12 | status, output = self.target.run(cmd) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | msg = 'Exit status was not 0. Output: %s' % output |
| 14 | self.assertEqual(status, 0, msg=msg) |
| 15 | |
| 16 | msg = 'Incorrect output: %s' % output |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 17 | self.assertEqual(output, "Hello, world", msg=msg) |