Tests the equality operator for the same search trajectory.
(ok_small)
| 93 | |
| 94 | |
| 95 | def test_more_eq(ok_small): |
| 96 | """ |
| 97 | Tests the equality operator for the same search trajectory. |
| 98 | """ |
| 99 | sol = Solution(ok_small, [[1, 2], [3, 4]]) |
| 100 | cost_eval = CostEvaluator([20], 6, 6) |
| 101 | |
| 102 | stats1 = Statistics() |
| 103 | stats2 = Statistics() |
| 104 | |
| 105 | assert_equal(stats1, stats2) |
| 106 | assert_(stats1 != "str") |
| 107 | |
| 108 | stats1.collect(sol, sol, sol, cost_eval) |
| 109 | assert_(stats1 != stats2) |
| 110 | |
| 111 | # Now do the same thing for stats2, so they have the seen the exact same |
| 112 | # search trajectory. That, however, is not enough: the runtimes are |
| 113 | # still slightly different. |
| 114 | stats2.collect(sol, sol, sol, cost_eval) |
| 115 | assert_(stats1 != stats2) |
| 116 | |
| 117 | # But once we fix that the two should be the exact same again. |
| 118 | stats2.runtimes = stats1.runtimes |
| 119 | assert_equal(stats1, stats2) |
| 120 | |
| 121 | |
| 122 | def test_iterating_over_statistics_returns_data(ok_small): |
nothing calls this directly
no test coverage detected