From 91c82b046e78d6c57fe10d5cc6f7902176cd020c Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 11 Dec 2023 16:53:44 +0000 Subject: [PATCH] tests: Re-format codegen.py with black MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- gio/tests/codegen.py | 81 ++++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/gio/tests/codegen.py b/gio/tests/codegen.py index c89c25c06..0681bb4e8 100644 --- a/gio/tests/codegen.py +++ b/gio/tests/codegen.py @@ -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 = """ @@ -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 = """ @@ -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 = """ @@ -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):