jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/505225 )
Change subject: textlib: add tests for sections headers with multiple levels
......................................................................
textlib: add tests for sections headers with multiple levels
Change-Id: I25218cc42c40951f7bfca2fa57f2253cb33e3ca3
---
M tests/textlib_tests.py
1 file changed, 29 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 187f2b5..990e937 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -1739,6 +1739,35 @@
('text\n\n', [('==title==', '\ncontent\n')],
'[[Category:A]]\n')
)
+ def test_with_h1_and_h2_sections(self):
+ """Test for text having h1 and h2 sections."""
+ self.assertEqual(
+ extract_sections(
+ 'text\n\n'
+ '=first level=\n'
+ 'foo\n'
+ '==title==\n'
+ 'bar',
+ self.site),
+ ('text\n\n',
+ [('=first level=', '\nfoo\n'), ('==title==',
'\nbar')],
+ '')
+ )
+
+ def test_with_h4_and_h2_sections(self):
+ """Test for text having h4 and h2 sections."""
+ self.assertEqual(
+ extract_sections(
+ 'text\n\n'
+ '====title====\n'
+ '==title 2==\n'
+ 'content',
+ self.site),
+ ('text\n\n',
+ [('====title====', '\n'), ('==title 2==',
'\ncontent')],
+ '')
+ )
+
if __name__ == '__main__': # pragma: no cover
try:
--
To view, visit
https://gerrit.wikimedia.org/r/505225
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I25218cc42c40951f7bfca2fa57f2253cb33e3ca3
Gerrit-Change-Number: 505225
Gerrit-PatchSet: 2
Gerrit-Owner: Whym <whym(a)whym.org>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Siebrand <siebrand(a)kitano.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)