Ejemplo n.º 1
0
 def test_parent_child_stop_point(self):
     xml_handler = NaptanXMLHandler(['639'], 'identifiers')
     parseString(test_stop_areas, xml_handler)
     areas = xml_handler.annotate_stop_area_ancestry(xml_handler.stop_areas)
     points, areas = xml_handler.annotate_stop_point_ancestry(xml_handler.stop_points, areas)
     self.assertEqual(points['639000022']['child_of'][0], areas['639GSHI21581']['id'])
     self.assertEqual(areas['639GSHI21581']['parent_of'][0], points['639000022']['id'])
Ejemplo n.º 2
0
 def test_parent_child_stop_areas_inactive(self):
     xml_handler = NaptanXMLHandler(['639'], 'identifiers')
     parseString(test_stop_areas, xml_handler)
     areas = xml_handler.annotate_stop_area_ancestry(xml_handler.stop_areas)
     with self.assertRaises(KeyError):
         self.assertEqual(areas['639GSHI21580']['child_of'][0], areas['639GSHI20121']['id'])