blob: 78c7ddda2c11e9e7fd459f297b4928367688a868 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
Patrick Williams92b42cb2022-09-03 06:53:57 -05002# Copyright OpenEmbedded Contributors
3#
Brad Bishopc342db32019-05-15 21:57:59 -04004# SPDX-License-Identifier: MIT
5#
6
Brad Bishop316dfdd2018-06-25 12:45:53 -04007import os
8
9from oeqa.runtime.case import OERuntimeTestCase
10from oeqa.core.decorator.depends import OETestDepends
11from oeqa.runtime.decorator.package import OEHasPackage
12
13class GObjectIntrospectionTest(OERuntimeTestCase):
14
15 @OETestDepends(["ssh.SSHTest.test_ssh"])
16 @OEHasPackage(["python3-pygobject"])
17 def test_python(self):
Brad Bishop19323692019-04-05 15:28:33 -040018 script = """from gi.repository import GLib; print(GLib.markup_escape_text("<testing&testing>"))"""
Brad Bishop316dfdd2018-06-25 12:45:53 -040019 status, output = self.target.run("python3 -c '%s'" % script)
20 self.assertEqual(status, 0, msg="Python failed (%s)" % (output))
21 self.assertEqual(output, "&lt;testing&amp;testing&gt;", msg="Unexpected output (%s)" % output)