1#
2# SPDX-License-Identifier: MIT
3#
4
5import os
6
7from oeqa.runtime.case import OERuntimeTestCase
8from oeqa.core.decorator.depends import OETestDepends
9from oeqa.runtime.decorator.package import OEHasPackage
10
11class GObjectIntrospectionTest(OERuntimeTestCase):
12
13    @OETestDepends(["ssh.SSHTest.test_ssh"])
14    @OEHasPackage(["python3-pygobject"])
15    def test_python(self):
16        script = """from gi.repository import GLib; print(GLib.markup_escape_text("<testing&testing>"))"""
17        status, output = self.target.run("python3 -c '%s'" % script)
18        self.assertEqual(status, 0, msg="Python failed (%s)" % (output))
19        self.assertEqual(output, "&lt;testing&amp;testing&gt;", msg="Unexpected output (%s)" % output)
20