def test_find_road_name_datastructure(self): """ Test data structure used to extract lat & lon """ # create variables needed for testing data = self.open_xml() pair_id = [u'5490', u'5491'] index = [0, -1] # tests nt.assert_equal(parse_xml(self.open_xml())[u'5490']\ [index[0]][u'lat'], u'42.71946') nt.assert_equal(parse_xml(self.open_xml())[u'5490']\ [index[0]][u'lon'], u'-71.20996') nt.assert_equal(parse_xml(self.open_xml())[u'5491']\ [index[1]][u'lat'], u'42.68083') nt.assert_equal(parse_xml(self.open_xml())[u'5491']\ [index[1]][u'lon'], u'-71.20208')
def test_parse_xml_values(self): """ Are the correct dictionary values returned given a key? """ nt.assert_equal(parse_xml(self.open_xml())[u'5490'], \ [OrderedDict([(u'lat', u'42.71946'), (u'lon', u'-71.20996')]), OrderedDict([(u'lat', u'42.71941'), (u'lon', u'-71.20972')])])
def test_parse_xml_keys(self): """ Are the correct dictionary keys returned? """ nt.assert_equal(parse_xml(self.open_xml()).keys(),\ [u'5490', u'5491'])