Tests that appending nodes to a route increases the route's length.
(ok_small)
| 96 | |
| 97 | |
| 98 | def test_route_append_increases_route_len(ok_small): |
| 99 | """ |
| 100 | Tests that appending nodes to a route increases the route's length. |
| 101 | """ |
| 102 | route = Route(ok_small, idx=0, vehicle_type=0) |
| 103 | assert_equal(route.num_clients(), 0) |
| 104 | |
| 105 | node = Node(loc=1) |
| 106 | route.append(node) |
| 107 | assert_equal(route.num_clients(), 1) |
| 108 | assert_(route[1] is node) # pointers, so must be same object |
| 109 | |
| 110 | node = Node(loc=2) |
| 111 | route.append(node) |
| 112 | assert_equal(route.num_clients(), 2) |
| 113 | assert_(route[2] is node) # pointers, so must be same object |
| 114 | |
| 115 | |
| 116 | def test_route_insert(ok_small): |
nothing calls this directly
no test coverage detected