]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/blob - tests/test_lib_sledrun_wikitext_to_json.py
Create function get_sledrun_description.
[philipp/winterrodeln/wrpylib.git] / tests / test_lib_sledrun_wikitext_to_json.py
1 import unittest
2
3 from mwparserfromhell import parse
4
5 from wrpylib.lib_sledrun_wikitext_to_json import get_sledrun_description
6
7
8 class TestGetSledrunDescription(unittest.TestCase):
9     def test_get_sledrun_description(self):
10         wikitext = "== Allgemeines ==\n{{Rodelbahnbox}}\nDas ist ''die'' Beschreibung.\n" + \
11                     "Weitere Details bei https://example.com.\n\n* Position\n"
12         wikicode = parse(wikitext)
13         expected = "Das ist ''die'' Beschreibung.\nWeitere Details bei https://example.com."
14         actual = get_sledrun_description(wikicode)
15         self.assertEqual(expected, actual)