X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/blobdiff_plain/f64a954a8596d88ee77707d2c42892aba161b385..d15807a959ef58367d9644d4ca95ee52f39cd5b4:/tests/test_mwmarkup.py diff --git a/tests/test_mwmarkup.py b/tests/test_mwmarkup.py index a1fa937..b8a12a2 100644 --- a/tests/test_mwmarkup.py +++ b/tests/test_mwmarkup.py @@ -82,3 +82,31 @@ def test_create_template(): assert wikitext_generated == wikitext +def test_parse_googlemap(): + wikitext = u''' + + (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 + + ''' + 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', u'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)])]