poky/meta/lib/oeqa/runtime/cases/gi.py
Alexander Kanavin 84e9159827 lib/oeqa/runtime/cases/gi.py: fix deprecation warning
With newest Python, the following is printed:

PyGIDeprecationWarning: GObject.markup_escape_text is deprecated; use GLib.markup_escape_text instead)

(From OE-Core rev: 7b4302d84e6c9833089bd575c1083fe826082387)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-02 11:06:00 +00:00

16 lines
687 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 GLib; print(GLib.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)