blob: 42bd100a319820cb61293e83f2e86c072c468903 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
2# SPDX-License-Identifier: MIT
3#
4
Brad Bishop316dfdd2018-06-25 12:45:53 -04005import 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):
Brad Bishop19323692019-04-05 15:28:33 -040016 script = """from gi.repository import GLib; print(GLib.markup_escape_text("<testing&testing>"))"""
Brad Bishop316dfdd2018-06-25 12:45:53 -040017 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)