Tests marking and unmarking all clients as promising.
(ok_small)
| 124 | |
| 125 | |
| 126 | def test_all_promising(ok_small): |
| 127 | """ |
| 128 | Tests marking and unmarking all clients as promising. |
| 129 | """ |
| 130 | clients = range(ok_small.num_depots, ok_small.num_locations) |
| 131 | |
| 132 | # Initially no clients start off promising. |
| 133 | search_space = SearchSpace(ok_small, compute_neighbours(ok_small)) |
| 134 | assert_(not any(search_space.is_promising(client) for client in clients)) |
| 135 | |
| 136 | # But after marking all as promising, they should all indeed be promising. |
| 137 | search_space.mark_all_promising() |
| 138 | assert_(all(search_space.is_promising(client) for client in clients)) |
| 139 | |
| 140 | # After unmarking all, no client should be promising. |
| 141 | search_space.unmark_all_promising() |
| 142 | assert_(not any(search_space.is_promising(client) for client in clients)) |
| 143 | |
| 144 | |
| 145 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected