mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 04:15:49 +01:00
tests: Check "gdbus-codegen --generate-rst"
Verify that the command line argument works, by checking it's not writing to stdout/stderr, and that the generate file isn't empty.
This commit is contained in:
parent
1437be8049
commit
4db9d43f1a
@ -382,6 +382,26 @@ G_END_DECLS
|
|||||||
# The output should be the same.
|
# The output should be the same.
|
||||||
self.assertEqual(result1.out, result2.out)
|
self.assertEqual(result1.out, result2.out)
|
||||||
|
|
||||||
|
def test_generate_rst(self):
|
||||||
|
"""Test the basic functionality of the rst generator."""
|
||||||
|
xml_contents = """
|
||||||
|
<node>
|
||||||
|
<interface name="org.project.Bar.Frobnicator">
|
||||||
|
<method name="RandomMethod"/>
|
||||||
|
</interface>
|
||||||
|
</node>
|
||||||
|
"""
|
||||||
|
res = self.runCodegenWithInterface(
|
||||||
|
xml_contents,
|
||||||
|
"--generate-rst",
|
||||||
|
"test",
|
||||||
|
)
|
||||||
|
self.assertEqual("", res.err)
|
||||||
|
self.assertEqual("", res.out)
|
||||||
|
with open("test-org.project.Bar.Frobnicator.rst", "r") as f:
|
||||||
|
rst = f.readlines()
|
||||||
|
self.assertTrue(len(rst) != 0)
|
||||||
|
|
||||||
def test_glib_min_required_invalid(self):
|
def test_glib_min_required_invalid(self):
|
||||||
"""Test running with an invalid --glib-min-required."""
|
"""Test running with an invalid --glib-min-required."""
|
||||||
with self.assertRaises(subprocess.CalledProcessError):
|
with self.assertRaises(subprocess.CalledProcessError):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user