--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
+ <Placemark>
+ <name>Test LineString #1</name>
+ <LineString>
+ <tessellate>1</tessellate>
+ <coordinates>
+ -76.62861599999999,39.315609,0 -76.62606,39.312859,0 -76.62496899999999,39.311951,0 -76.624062,39.31134,0 -76.620209,39.30901,0 -76.61734,39.307499,0 -76.616272,39.306782,0 -76.61550099999999,39.30632,0 -76.614952,39.306091,0 -76.614441,39.305962,0 -76.613983,39.305908,0 -76.613152,39.305939,0 -76.612534,39.305889,0 -76.612038,39.30571,0
+ </coordinates>
+ </LineString>
+ </Placemark>
+</kml>
--- /dev/null
+import unittest
+
+import Tests.Fixtures
+from KML import *
+
+
+class LineStringTest(unittest.TestCase):
+
+ def testTuplesFromKml(self):
+ """
+ Make sure we parse KML LineStrings into tuples properly.
+ """
+
+ fixture_path = Tests.Fixtures.Path() + '/KML/linestring1.kml'
+ f = open(fixture_path, 'r')
+ kml = f.read()
+ f.close()
+
+ actual_tuples = LineString.tuples_from_kml(kml)
+
+ expected_tuples = [ (-76.62861599999999, 39.315609),
+ (-76.62606, 39.312859),
+ (-76.62496899999999, 39.311951),
+ (-76.624062, 39.31134),
+ (-76.620209, 39.30901),
+ (-76.61734, 39.307499),
+ (-76.616272, 39.306782),
+ (-76.61550099999999, 39.30632),
+ (-76.614952, 39.306091),
+ (-76.614441, 39.305962),
+ (-76.613983, 39.305908),
+ (-76.613152, 39.305939),
+ (-76.612534, 39.305889),
+ (-76.612038, 39.30571) ]
+
+ self.assertEqual(expected_tuples, actual_tuples)
+
+
+def suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(LineStringTest))
+ return suite