Test for create_wrmap now passes.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 29 Aug 2013 20:10:29 +0000 (20:10 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 29 Aug 2013 20:10:29 +0000 (20:10 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@1533 7aebc617-e5e2-0310-91dc-80fb5f6d2477

tests/test_wrmwmarkup.py
wrpylib/wrmwmarkup.py

index c0990c9c01295497bfc000f8e1cfaf10c06be660..393db5c299b01f92bc1180ea6492ca47ff175cd3 100644 (file)
@@ -136,19 +136,19 @@ def test_create_wrmap():
                 'geometry': {
                     'type': 'Point',
                     'coordinates': [11.190454, 47.240689]},
-                'properties': {'type': 'inn', 'name': u'Rosskogelhütte', 'wiki': u'Rosskogelhütte'}
+                'properties': {'type': 'gasthaus', 'name': u'Rosskogelhütte', 'wiki': u'Rosskogelhütte'}
             }, {
                 'type': 'Feature',
                 'geometry': {
                     'type': 'Point',
                     'coordinates': [11.238971, 47.245789]},
-                'properties': {'type': 'carpark'}
+                'properties': {'type': 'parkplatz'}
             }, {
                 'type': 'Feature',
                 'geometry': {
                     'type': 'Point',
                     'coordinates': [11.238283, 47.245711]},
-                'properties': {'type': 'busstop', 'name': u'Oberperfuss Rangger Köpfl Lift'}
+                'properties': {'type': 'haltestelle', 'name': u'Oberperfuss Rangger Köpfl Lift'}
             }, {
                 'type': 'Feature',
                 'geometry': {
@@ -157,7 +157,7 @@ def test_create_wrmap():
                         [11.203360, 47.238587],
                         [11.230868, 47.244951],
                         [11.237853, 47.245470]]},
-                'properties': {'type': 'sledrun'}
+                'properties': {'type': 'rodelbahn'}
             }],
         'properties': {
             'lon': 11.21408895,
@@ -171,9 +171,9 @@ def test_create_wrmap():
     assert wikitext == textwrap.dedent(u'''\
     <wrmap height="400" lat="47.2417134" lon="11.21408895" width="700" zoom="14">
 
-    <gasthaus name="Rosskogelhütte" wiki="Rosskogelhütte">47.240689 11.190454</gasthaus>
-    <parkplatz>47.245789 11.238971</parkplatz>
-    <haltestelle name="Oberperfuss Rangger Köpfl Lift">47.245711 11.238283</haltestelle>
+    <gasthaus name="Rosskogelhütte" wiki="Rosskogelhütte">47.240689 N 11.190454 E</gasthaus>
+    <parkplatz>47.245789 N 11.238971 E</parkplatz>
+    <haltestelle name="Oberperfuss Rangger Köpfl Lift">47.245711 N 11.238283 E</haltestelle>
 
     <rodelbahn>
     47.238587 N 11.203360 E
index b25ef636bfb38dd546cbbdd6c12be1052567a4c7..715dbac2fe8307a34a6d82633c6a15f1d3145d7d 100644 (file)
@@ -537,8 +537,7 @@ def create_wrmap(geojson):
         feature_xml.attrib = json_feature['properties']
         del feature_xml.attrib['type']
 
-    print last_json_feature.tag
     if last_json_feature is not None:
         last_json_feature.tail = '\n\n'
-    return xml.etree.ElementTree.tostring(wrmap_xml, encoding='utf-8')
+    return xml.etree.ElementTree.tostring(wrmap_xml, encoding='utf-8').decode('utf-8')