Merge branch 'alatiera/python-test' into 'main'

gio: tests: Use slightly more explicit assert functions

See merge request GNOME/glib!3872
This commit is contained in:
Philip Withnall 2024-02-02 14:29:26 +00:00
commit 35f42d0c8c

View File

@ -479,7 +479,7 @@ G_END_DECLS
self.assertEqual("", res.out) self.assertEqual("", res.out)
with open("test-org.project.Bar.Frobnicator.xml", "r") as f: with open("test-org.project.Bar.Frobnicator.xml", "r") as f:
xml_data = f.readlines() xml_data = f.readlines()
self.assertTrue(len(xml_data) != 0) self.assertNotEqual(len(xml_data), 0)
def test_generate_md(self): def test_generate_md(self):
"""Test the basic functionality of the markdown generator.""" """Test the basic functionality of the markdown generator."""
@ -499,7 +499,7 @@ G_END_DECLS
self.assertEqual("", res.out) self.assertEqual("", res.out)
with open("test-org.project.Bar.Frobnicator.md", "r") as f: with open("test-org.project.Bar.Frobnicator.md", "r") as f:
rst = f.readlines() rst = f.readlines()
self.assertTrue(len(rst) != 0) self.assertNotEqual(len(rst), 0)
def test_generate_rst(self): def test_generate_rst(self):
"""Test the basic functionality of the rst generator.""" """Test the basic functionality of the rst generator."""
@ -519,7 +519,7 @@ G_END_DECLS
self.assertEqual("", res.out) self.assertEqual("", res.out)
with open("test-org.project.Bar.Frobnicator.rst", "r") as f: with open("test-org.project.Bar.Frobnicator.rst", "r") as f:
rst = f.readlines() rst = f.readlines()
self.assertTrue(len(rst) != 0) self.assertNotEqual(len(rst), 0)
def test_generate_rst_method(self): def test_generate_rst_method(self):
"""Test generating a method documentation with the rst generator.""" """Test generating a method documentation with the rst generator."""
@ -1472,7 +1472,7 @@ G_END_DECLS
self.assertEqual("", res.err) self.assertEqual("", res.err)
self.assertEqual("", res.out) self.assertEqual("", res.out)
with open("test-org.project.Bar.Frobnicator.xml", "r") as f: with open("test-org.project.Bar.Frobnicator.xml", "r") as f:
self.assertTrue(ET.parse(f) is not None) self.assertIsNotNone(ET.parse(f))
def test_indentation_preservation_in_comments(self): def test_indentation_preservation_in_comments(self):
"""Test if the parser preserves relative indentation in XML comments""" """Test if the parser preserves relative indentation in XML comments"""