Beispiel #1
0
def test_elevation_parse_good_response():
    elev_data = ElevationDataRetrieval([], [])
    response = MockResponse()
    response.good_elev_response()
    parsed = elev_data.parse_elevation_data(response.json_data)
    assert(parsed == True)
    assert(response.status_code == 200)
    filepath = '../optimization/elevations.csv'
    assert(os.path.isfile(filepath) == True)
    os.remove(filepath)
Beispiel #2
0
def test_elevation_getter_bad_inputs():
    waypoints = [{}, {}]
    viawaypoints = [[{}]]
    elev = ElevationDataRetrieval(waypoints, viawaypoints)
    response = elev.get_elevation_data()
    assert(response.status_code == 500) 
Beispiel #3
0
def test_elevation_getter_good_inputs():
    waypoints = [{"45": "-74"}, {"46": "-75"}]
    viawaypoints = [[{"45.5": "-74.5"}]]
    elev = ElevationDataRetrieval(waypoints, viawaypoints)
    response = elev.get_elevation_data()
    assert(response.status_code == 200)
Beispiel #4
0
def test_elevation_parse_bad_response():
    elev_data = ElevationDataRetrieval([], [])
    response = MockResponse()
    assert(elev_data.parse_elevation_data(response.json_data) == False)