Skip to content

Commit

Permalink
test that SchemaData is read from kml, bugfix for this
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Nov 27, 2013
1 parent 5843379 commit 1a0d7e1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
7 changes: 7 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
Changelog
=========

0.6 (unreleased)
----------------

- add Schema
- add SchemaData
- make use of lxmls default namespace

0.5 (2013/10/23)
-----------------

Expand Down
2 changes: 1 addition & 1 deletion docs/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
To Do
======

- Schema and Extended Data
- add untyped custom data with namespace prefix
- Overlays


4 changes: 2 additions & 2 deletions fastkml/kml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,9 @@ def from_element(self, element):
el = Data(self.ns)
el.from_element(ud)
self.elements.append(el)
typed_data = element.findall('%sSimpleData' % self.ns)
typed_data = element.findall('%sSchemaData' % self.ns)
for sd in typed_data:
el = SimpleData(self.ns)
el = SchemaData(self.ns, 'dummy')
el.from_element(sd)
self.elements.append(el)

Expand Down
4 changes: 3 additions & 1 deletion fastkml/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,9 @@ def test_extended_data(self):
self.assertTrue(
'<i>The par for this hole is </i>' in extended_data.elements[1].display_name
)

sd = extended_data.elements[2]
self.assertEqual(sd.data[0]['name'], 'TrailHeadName')
self.assertEqual(sd.data[1]['value'], '347.45')

def test_polygon(self):
doc= """<kml xmlns="http://www.opengis.net/kml/2.2">
Expand Down

0 comments on commit 1a0d7e1

Please sign in to comment.