Ejemplo n.º 1
0
 def test_datasources_for_correct_values_returned(self):
     """ Unpack the tuple & make sure it matches the docstring """
     import os
     # creating the correct folder locations
     folder_location = os.path.abspath("")+ \
                   "/MassDOThack/Road_RTTM_Volume/"
     massdot_bluetoad_data = folder_location + \
                             "massdot_bluetoad_data/" + \
                             "massdot_bluetoad_data.csv"
     pair_definitions = folder_location + \
                        "pair_definitions.csv"
     pair_routes = folder_location + \
                   "pair_routes.xml"
     # unpack tuple
     ds1, ds2, ds3 = datasources()
     # test to see if they match
     nt.assert_equal(ds1, massdot_bluetoad_data)
     nt.assert_equal(ds2, pair_definitions)
     nt.assert_equal(ds3, pair_routes)
Ejemplo n.º 2
0
 def test_datasources_for_correct_values_returned(self):
     """ Unpack the tuple & make sure it matches the docstring """
     import os
     # creating the correct folder locations
     folder_location = os.path.abspath("")+ \
                   "/MassDOThack/Road_RTTM_Volume/"
     massdot_bluetoad_data = folder_location + \
                             "massdot_bluetoad_data/" + \
                             "massdot_bluetoad_data.csv"
     pair_definitions = folder_location + \
                        "pair_definitions.csv"
     pair_routes = folder_location + \
                   "pair_routes.xml"
     # unpack tuple
     ds1,ds2,ds3 = datasources()
     # test to see if they match
     nt.assert_equal(ds1,massdot_bluetoad_data)
     nt.assert_equal(ds2,pair_definitions)
     nt.assert_equal(ds3,pair_routes)
Ejemplo n.º 3
0
def open_xml():
    """ Opens pair_routes.xml and returns a dictionary """
    gb1,gb2,pair_routes = datasources()
    with open(pair_routes) as fd:
        obj = xmltodict.parse(fd.read())
    return obj