[glib/ebassi/gdbus-codegen-rst: 7/7] tests: Check "gdbus-codegen --generate-docbook"




commit ba2725f263fda5c3a7bfa04bb327f554a17c205f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Jan 21 17:36:59 2022 +0000

    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.

 gio/tests/codegen.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
---
diff --git a/gio/tests/codegen.py b/gio/tests/codegen.py
index 262fa074f..c95736e39 100644
--- a/gio/tests/codegen.py
+++ b/gio/tests/codegen.py
@@ -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 = """


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]