aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2020-01-22 07:01:53 -0800
committerTim Orling <ticotimo@gmail.com>2020-01-29 22:04:57 -0800
commitca37c2bfb02708f2513c8d86a661b1c784711b1b (patch)
treefd47ed428a0c80917ec4830f30090fcb97b925a1
parent7387ab0f44ff09c1423e87c488aff3e2654839f8 (diff)
downloadmeta-python2-ca37c2bfb02708f2513c8d86a661b1c784711b1b.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>
-rw-r--r--lib/oeqa/runtime/cases/python2.py20
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)