...
 
Commits (2)
......@@ -48,8 +48,8 @@ date_range_time = re.compile(r"^(\d+)\.(\d+)\.(\d+)\s+(\d+)[:\.](\d+)\s*\-\s*(\d
weekday_time = re.compile(r"^([a-zA-Z0-9/]+),?\s*(\d+)[:\.](\d+)$")
weekday_time_range = re.compile(r"^([a-zA-Z0-9/]+),?\s*(\d+)[:\.](\d+)\s*\-\s*(\d+)[:\.](\d+)$")
mediawiki_intern_link = re.compile(r"(\[\[([^|]+)\|?(.*?)\]\])")
mediawiki_extern_link = re.compile(r"(\[([^\ ]+)\s+(.*?)\])")
mediawiki_intern_link = re.compile(r"(\[\[([^|\[\]]+)\|?([^\[\]]*?)\]\])")
mediawiki_extern_link = re.compile(r"(\[([^\[\] ]+)\s+([^\[\]]*?)\])")
mediawiki_bold = re.compile(r"'''(.*?)'''")
mediawiki_emph = re.compile(r"''(.*?)''")
......
# -.- coding: utf8 -.-
import sys
import unittest
import calendargenerator as cg
......@@ -26,6 +27,8 @@ class TestUserInputError(unittest.TestCase):
| some party || 22.05.2015 20:00 - 03:00 ||
"""
result = cg.parse_wiki_page(content)
sys.stderr.write("(Note: InvalidDates were expected)")
sys.stderr.flush()
for entry in result:
self.assertLessEqual(entry.start_datetime(), entry.end_datetime())
self.assertEqual(len(result), 1)
......@@ -32,7 +32,12 @@ class TestUrls(unittest.TestCase):
self.assertEqual(url_date.getURL(), "https://stratum0.net/")
self.assertEqual(url_date.getPlainName(), "abc title")
def test_multiURL(self):
def test_multiInternalURL(self):
url_date = cg.SingleDate("[[Vorträge]] ([[Vorträge/Vorbei|Aufzeichnungen]])", "cat", [20, 9, 2014])
self.assertEqual(url_date.getPlainName(), "Vorträge (Aufzeichnungen)")
self.assertEqual(url_date.getURL(), "https://stratum0.org/wiki/Vortr%C3%A4ge")
def test_multiExternalURL(self):
url_date = cg.SingleDate("[https://events.ccc.de/congress/2014/ 31C3] ([https://events.ccc.de/congress/2014/wiki/Assembly:Stratum_0 Assembly])", "cat", [20, 9, 2014])
self.assertEqual(url_date.getPlainName(), "31C3 (Assembly)")
self.assertEqual(url_date.getURL(), "https://events.ccc.de/congress/2014/")
......
......@@ -31,7 +31,7 @@ ignore this text
{| class="prettytable"
! Event !! Termin !! Im Zeitraum
|-
|[[Vorträge]] || 14.08.2014 19:00 ||
|[[Vorträge]] ([[Vorträge/Vorbei|Aufzeichungen]]) || 14.08.2014 19:00 ||
|-
|[[Vorträge]] || 14.09.2014 19:00 ||
|}
......