Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: MIT |
| 3 | # |
| 4 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 5 | import os |
| 6 | |
| 7 | from oeqa.runtime.case import OERuntimeTestCase |
| 8 | from oeqa.core.decorator.depends import OETestDepends |
| 9 | from oeqa.runtime.decorator.package import OEHasPackage |
| 10 | |
| 11 | class GObjectIntrospectionTest(OERuntimeTestCase): |
| 12 | |
| 13 | @OETestDepends(["ssh.SSHTest.test_ssh"]) |
| 14 | @OEHasPackage(["python3-pygobject"]) |
| 15 | def test_python(self): |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | script = """from gi.repository import GLib; print(GLib.markup_escape_text("<testing&testing>"))""" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 17 | status, output = self.target.run("python3 -c '%s'" % script) |
| 18 | self.assertEqual(status, 0, msg="Python failed (%s)" % (output)) |
| 19 | self.assertEqual(output, "<testing&testing>", msg="Unexpected output (%s)" % output) |