mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
tests: Re-format codegen.py with black
This is just the result of running `black $(git ls-files '*.py')`. For some reason, the `sh-and-py-check` CI job didn’t run on merge request !3751, so this non-standard formatting slipped through onto `main`. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3754#note_1939914 Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
b96778ee43
commit
91c82b046e
@ -521,7 +521,7 @@ G_END_DECLS
|
||||
rst = f.readlines()
|
||||
self.assertTrue(len(rst) != 0)
|
||||
|
||||
def test_generate_rst_method(self):
|
||||
def test_generate_rst_method(self):
|
||||
"""Test generating a method documentation with the rst generator."""
|
||||
xml_contents = """
|
||||
<node>
|
||||
@ -543,24 +543,29 @@ G_END_DECLS
|
||||
self.assertEqual("", res.out)
|
||||
with open("test-org.project.Bar.Frobnicator.rst", "r") as f:
|
||||
rst = f.read()
|
||||
self.assertIn(textwrap.dedent("""
|
||||
-------
|
||||
Methods
|
||||
-------
|
||||
self.assertIn(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
-------
|
||||
Methods
|
||||
-------
|
||||
|
||||
.. _org.project.Bar.Frobnicator.RandomMethod:
|
||||
.. _org.project.Bar.Frobnicator.RandomMethod:
|
||||
|
||||
org.project.Bar.Frobnicator.RandomMethod
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
org.project.Bar.Frobnicator.RandomMethod
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
::
|
||||
::
|
||||
|
||||
RandomMethod ()
|
||||
RandomMethod ()
|
||||
|
||||
|
||||
A random test method."""), rst)
|
||||
A random test method."""
|
||||
),
|
||||
rst,
|
||||
)
|
||||
|
||||
def test_generate_rst_signal(self):
|
||||
def test_generate_rst_signal(self):
|
||||
"""Test generating a signal documentation with the rst generator."""
|
||||
xml_contents = """
|
||||
<node>
|
||||
@ -582,24 +587,29 @@ G_END_DECLS
|
||||
self.assertEqual("", res.out)
|
||||
with open("test-org.project.Bar.Frobnicator.rst", "r") as f:
|
||||
rst = f.read()
|
||||
self.assertIn(textwrap.dedent("""
|
||||
-------
|
||||
Signals
|
||||
-------
|
||||
self.assertIn(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
-------
|
||||
Signals
|
||||
-------
|
||||
|
||||
.. _org.project.Bar.Frobnicator::RandomSignal:
|
||||
.. _org.project.Bar.Frobnicator::RandomSignal:
|
||||
|
||||
org.project.Bar.Frobnicator::RandomSignal
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
org.project.Bar.Frobnicator::RandomSignal
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
::
|
||||
::
|
||||
|
||||
RandomSignal ()
|
||||
RandomSignal ()
|
||||
|
||||
|
||||
A random test signal."""), rst)
|
||||
A random test signal."""
|
||||
),
|
||||
rst,
|
||||
)
|
||||
|
||||
def test_generate_rst_property(self):
|
||||
def test_generate_rst_property(self):
|
||||
"""Test generating a property documentation with the rst generator."""
|
||||
xml_contents = """
|
||||
<node>
|
||||
@ -621,22 +631,27 @@ G_END_DECLS
|
||||
self.assertEqual("", res.out)
|
||||
with open("test-org.project.Bar.Frobnicator.rst", "r") as f:
|
||||
rst = f.read()
|
||||
self.assertIn(textwrap.dedent("""
|
||||
----------
|
||||
Properties
|
||||
----------
|
||||
self.assertIn(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
----------
|
||||
Properties
|
||||
----------
|
||||
|
||||
.. _org.project.Bar.Frobnicator:RandomProperty:
|
||||
.. _org.project.Bar.Frobnicator:RandomProperty:
|
||||
|
||||
org.project.Bar.Frobnicator:RandomProperty
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
org.project.Bar.Frobnicator:RandomProperty
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
::
|
||||
::
|
||||
|
||||
RandomProperty readable s
|
||||
RandomProperty readable s
|
||||
|
||||
|
||||
A random test property."""), rst)
|
||||
A random test property."""
|
||||
),
|
||||
rst,
|
||||
)
|
||||
|
||||
@unittest.skipIf(on_win32(), "requires /dev/stdout")
|
||||
def test_glib_min_required_invalid(self):
|
||||
|
Loading…
Reference in New Issue
Block a user