xref: /OK3568_Linux_fs/yocto/poky/meta/lib/oeqa/runtime/cases/python.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#
2# SPDX-License-Identifier: MIT
3#
4
5from oeqa.runtime.case import OERuntimeTestCase
6from oeqa.core.decorator.depends import OETestDepends
7from oeqa.runtime.decorator.package import OEHasPackage
8
9class PythonTest(OERuntimeTestCase):
10    @OETestDepends(['ssh.SSHTest.test_ssh'])
11    @OEHasPackage(['python3-core'])
12    def test_python3(self):
13        cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
14        status, output = self.target.run(cmd)
15        msg = 'Exit status was not 0. Output: %s' % output
16        self.assertEqual(status, 0, msg=msg)
17
18        msg = 'Incorrect output: %s' % output
19        self.assertEqual(output, "Hello, world", msg=msg)
20