Added test for parse_googlemap
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Mon, 12 Aug 2013 21:19:03 +0000 (21:19 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Mon, 12 Aug 2013 21:19:03 +0000 (21:19 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@1511 7aebc617-e5e2-0310-91dc-80fb5f6d2477

tests/test_mwmarkup.py

index a1fa937b6d395f93e1f57f881bbfb7504a3c780f..97feef3daa129df8bbb4bfc1cc09ea53ef03e93b 100644 (file)
@@ -82,3 +82,31 @@ def test_create_template():
     assert wikitext_generated == wikitext
 
 
+def test_parse_googlemap():
+    wikitext = '''
+    <googlemap version="0.9" lat="47.113291" lon="11.272337" zoom="15">
+    (Parkplatz)47.114958,11.266026
+    Erster Parkplatz
+    
+    (Gasthaus) 47.114715, 11.266262, Alt Bärnbad (Gasthaus)
+    6#FF014E9A
+    47.114715,11.266262
+    47.114135,11.268381
+    47.113421,11.269322
+    47.11277,11.269979
+    47.112408,11.271119
+    </googlemap>
+    '''
+    center, zoom, coords, paths = wrpylib.mwmarkup.parse_googlemap(wikitext)
+    assert center == (11.272337, 47.113291)
+    assert zoom == 15
+    assert coords == [
+        (11.266026, 47.114958, 'Parkplatz', 'Erster Parkplatz'),
+        (11.266262, 47.114715, 'Gasthaus', 'Alt Bärnbad (Gasthaus)')]
+    assert paths == [
+        ('6#FF014E9A', [
+            (11.266262, 47.114715, None, None),
+            (11.268381, 47.114135, None, None),
+            (11.269322, 47.113421, None, None),
+            (11.269979, 47.11277, None, None),
+            (11.271119, 47.112408, None, None)])]