mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-21 17:52:11 +01:00
tests: Use textwrap.dedent to indent expected strings pleasingly
This introduces no functional changes. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
4e4471663c
commit
737b08e96f
@ -28,6 +28,7 @@ import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import textwrap
|
||||
import unittest
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
@ -541,7 +542,7 @@ G_END_DECLS
|
||||
self.assertEqual("", res.out)
|
||||
with open("test-org.project.Bar.Frobnicator.rst", "r") as f:
|
||||
rst = f.read()
|
||||
self.assertIn("""
|
||||
self.assertIn(textwrap.dedent("""
|
||||
-------
|
||||
Methods
|
||||
-------
|
||||
@ -556,7 +557,7 @@ org.project.Bar.Frobnicator.RandomMethod
|
||||
RandomMethod ()
|
||||
|
||||
|
||||
A random test method.""", rst)
|
||||
A random test method."""), rst)
|
||||
|
||||
def test_generate_rst_signal(self):
|
||||
"""Test generating a signal documentation with the rst generator."""
|
||||
@ -580,7 +581,7 @@ A random test method.""", rst)
|
||||
self.assertEqual("", res.out)
|
||||
with open("test-org.project.Bar.Frobnicator.rst", "r") as f:
|
||||
rst = f.read()
|
||||
self.assertIn("""
|
||||
self.assertIn(textwrap.dedent("""
|
||||
-------
|
||||
Signals
|
||||
-------
|
||||
@ -595,7 +596,7 @@ org.project.Bar.Frobnicator::RandomSignal
|
||||
RandomSignal ()
|
||||
|
||||
|
||||
A random test signal.""", rst)
|
||||
A random test signal."""), rst)
|
||||
|
||||
def test_generate_rst_property(self):
|
||||
"""Test generating a property documentation with the rst generator."""
|
||||
@ -619,7 +620,7 @@ A random test signal.""", rst)
|
||||
self.assertEqual("", res.out)
|
||||
with open("test-org.project.Bar.Frobnicator.rst", "r") as f:
|
||||
rst = f.read()
|
||||
self.assertIn("""
|
||||
self.assertIn(textwrap.dedent("""
|
||||
----------
|
||||
Properties
|
||||
----------
|
||||
@ -634,7 +635,7 @@ org.project.Bar.Frobnicator:RandomProperty
|
||||
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…
x
Reference in New Issue
Block a user