One way to test a router is to write a main method for it in Python. For example, at the end of orienteering_router.py
, there is a short main()
method that tests the router.
Once that's working, this is another way to test the router that integrates the whole Python route planner.
Setup
reqdata
is the request to send to the route planner.- The script will print out the response object.
Usage
- Run the route planner's
start_server.py
. node client.js
Notes
- Through the magic of gRPC, a call to
stub.PlanRoute
in the client is equivalent to a call toRoutePlanner.PlanRoute
instart_server.py
.RoutePlanner.PlanRoute
chooses which router is called. - Thus, for a router X to be called in the backend, first the logic to dispatch to X must be added to
RoutePlanner.PlanRoute
instart_server.py
. Then, the request data must meet the requirements to dispatch to X.