]>
gitweb.michael.orlitzky.com - dead/census-tools.git/blob - Tests/Unit/KMLTest.py
7 class LineStringTest(unittest
.TestCase
):
9 def testTuplesFromKml(self
):
11 Make sure we parse KML LineStrings into tuples properly.
14 fixture_path
= Tests
.Fixtures
.Path() + '/KML/linestring1.kml'
15 f
= open(fixture_path
, 'r')
19 actual_tuples
= LineString
.tuples_from_kml(kml
)
21 expected_tuples
= [ (-76.62861599999999, 39.315609),
22 (-76.62606, 39.312859),
23 (-76.62496899999999, 39.311951),
24 (-76.624062, 39.31134),
25 (-76.620209, 39.30901),
26 (-76.61734, 39.307499),
27 (-76.616272, 39.306782),
28 (-76.61550099999999, 39.30632),
29 (-76.614952, 39.306091),
30 (-76.614441, 39.305962),
31 (-76.613983, 39.305908),
32 (-76.613152, 39.305939),
33 (-76.612534, 39.305889),
34 (-76.612038, 39.30571) ]
36 self
.assertEqual(expected_tuples
, actual_tuples
)
40 suite
= unittest
.TestSuite()
41 suite
.addTest(unittest
.makeSuite(LineStringTest
))