diff --git a/tests/test_charge_routing.py b/tests/test_charge_routing.py new file mode 100644 index 0000000000000000000000000000000000000000..b14a78e6250bcce036b3a2e92da981172a5f58af --- /dev/null +++ b/tests/test_charge_routing.py @@ -0,0 +1,18 @@ +from evrouting.charge import shortest_path + +from .config import edge_case, get_graph + + +def test_shortest_path(): + G = get_graph(edge_case) + + path = shortest_path( + G, + s=edge_case['s'], + t=edge_case['t'], + b_0=edge_case['b_0'], + b_t=edge_case['b_t'], + U=edge_case['U'] + ) + + assert path == [(0, 2), (1, 0), (2, 0)] diff --git a/tests/test_gasstation_routing.py b/tests/test_gasstation_routing.py new file mode 100644 index 0000000000000000000000000000000000000000..15865022192017779f5dacd810a053ac8eda6e95 --- /dev/null +++ b/tests/test_gasstation_routing.py @@ -0,0 +1,18 @@ +from evrouting.gasstation import shortest_path + +from .config import edge_case, get_graph + + +def test_shortest_path(): + G = get_graph(edge_case) + + path = shortest_path( + G, + s=edge_case['s'], + t=edge_case['t'], + b_0=edge_case['b_0'], + b_t=edge_case['b_t'], + U=edge_case['U'] + ) + + assert path == [(0, 4), (2, 0)]