tests: Check "gdbus-codegen --generate-docbook"

Verify that the command line argument works, by checking it's not writing
to stdout/stderr, and that the generated file isn't empty.
This commit is contained in:
Emmanuele Bassi 2022-01-21 17:36:59 +00:00
parent 4db9d43f1a
commit ba2725f263

View File

@ -382,6 +382,26 @@ G_END_DECLS
# The output should be the same.
self.assertEqual(result1.out, result2.out)
def test_generate_docbook(self):
"""Test the basic functionality of the docbook generator."""
xml_contents = """
<node>
<interface name="org.project.Bar.Frobnicator">
<method name="RandomMethod"/>
</interface>
</node>
"""
res = self.runCodegenWithInterface(
xml_contents,
"--generate-docbook",
"test",
)
self.assertEqual("", res.err)
self.assertEqual("", res.out)
with open("test-org.project.Bar.Frobnicator.xml", "r") as f:
xml_data = f.readlines()
self.assertTrue(len(xml_data) != 0)
def test_generate_rst(self):
"""Test the basic functionality of the rst generator."""
xml_contents = """