poky/meta/lib/oeqa/runtime/cases/gi.py
Ross Burton f05dc3f817 oeqa/runtime: add gobject-introspection test
(From OE-Core rev: 497a95b576e19e39e20ac280d0db24f51b7c9679)

(From OE-Core rev: 7fe336e34bbdc16a28f95ce6ec043943f8033002)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-29 10:31:58 +00:00

16 lines
693 B
Python

import os
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.runtime.decorator.package import OEHasPackage
class GObjectIntrospectionTest(OERuntimeTestCase):
@OETestDepends(["ssh.SSHTest.test_ssh"])
@OEHasPackage(["python3-pygobject"])
def test_python(self):
script = """from gi.repository import GObject; print(GObject.markup_escape_text("<testing&testing>"))"""
status, output = self.target.run("python3 -c '%s'" % script)
self.assertEqual(status, 0, msg="Python failed (%s)" % (output))
self.assertEqual(output, "&lt;testing&amp;testing&gt;", msg="Unexpected output (%s)" % output)