def test_format_routes_query_invalid_points_default_inputs(): points = [{"45": "-74"}, {"46": "-75"}] try: # should throw a TypeError exception, test should pass if so query = rts.format_routes_query(points) except TypeError as err: assert (str(err) == 'can only concatenate str (not "dict") to str')
def test_format_routes_query_valid_points_default_inputs(): waypoints = [{"45": "-74"}, {"46": "-75"}] viawaypoints = [{"45.5": "-74.5"}] points = rts.build_routes_points(waypoints, viawaypoints) query = rts.format_routes_query(points) check = "Routes?wp.0=45,-74&vwp.1=45.5,-74.5&wp.2=46,-75&"+\ "routeAttributes={}&distanceUnit={}".format("routePath", "km") assert (query == check)