From ca37c2bfb02708f2513c8d86a661b1c784711b1b Mon Sep 17 00:00:00 2001 From: Tim Orling Date: Wed, 22 Jan 2020 07:01:53 -0800 Subject: lib/oeqa/runtime/cases: add python2.py Refactor the python3 test from oe-core to do very basic acceptance test of python2. Signed-off-by: Tim Orling --- lib/oeqa/runtime/cases/python2.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/oeqa/runtime/cases/python2.py diff --git a/lib/oeqa/runtime/cases/python2.py b/lib/oeqa/runtime/cases/python2.py new file mode 100644 index 0000000..8afa2ac --- /dev/null +++ b/lib/oeqa/runtime/cases/python2.py @@ -0,0 +1,20 @@ +# +# SPDX-License-Identifier: MIT +# + +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.core.decorator.depends import OETestDepends +from oeqa.runtime.decorator.package import OEHasPackage + + +class PythonTest(OERuntimeTestCase): + @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['python-core']) + def test_python(self): + cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" + status, output = self.target.run(cmd) + msg = 'Exit status was not 0. Output: %s' % output + self.assertEqual(status, 0, msg=msg) + + msg = 'Incorrect output: %s' % output + self.assertEqual(output, "Hello, world", msg=msg) -- cgit 1.2.3-korg