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