Tests that inserting clients can fail if inserting is too expensive and the insert is not required.
(ok_small)
| 55 | |
| 56 | |
| 57 | def test_insert_required(ok_small): |
| 58 | """ |
| 59 | Tests that inserting clients can fail if inserting is too expensive and |
| 60 | the insert is not required. |
| 61 | """ |
| 62 | data = ok_small |
| 63 | search_space = SearchSpace(data, compute_neighbours(data)) |
| 64 | cost_eval = CostEvaluator([0], 0, 0) |
| 65 | |
| 66 | # Start with an empty solution and try to insert the first client without |
| 67 | # requiring an insert. Inserting should fail: it's not worth it, since the |
| 68 | # client has no prize. However, inserting should succeed when required. |
| 69 | sol = Solution(data) |
| 70 | assert_(not sol.insert(sol.nodes[1], search_space, cost_eval, False)) |
| 71 | assert_(sol.insert(sol.nodes[1], search_space, cost_eval, True)) |
nothing calls this directly
no test coverage detected