python.py 652 B

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