diff options
author | Tim Orling <ticotimo@gmail.com> | 2020-01-22 07:01:53 -0800 |
---|---|---|
committer | Tim Orling <ticotimo@gmail.com> | 2020-01-22 07:01:53 -0800 |
commit | 65e513de63d66651bab216e1841f389f8cc689c8 (patch) | |
tree | 3a46f7b38bc754a47ab0cdf7e25a3467515e3576 /lib | |
parent | fdcc87af311e8ef32672190974dd343e6a32f602 (diff) | |
download | meta-python2-65e513de63d66651bab216e1841f389f8cc689c8.tar.gz |
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 <ticotimo@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/oeqa/runtime/cases/python2.py | 20 |
1 files changed, 20 insertions, 0 deletions
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) |