python.py 688 B

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