test for the knapsack repetition
(self)
| 49 | assert k.knapsack(cap, w, val, c) == 220 |
| 50 | |
| 51 | def test_knapsack_repetition(self): |
| 52 | """ |
| 53 | test for the knapsack repetition |
| 54 | """ |
| 55 | cap = 50 |
| 56 | val = [60, 100, 120] |
| 57 | w = [10, 20, 30] |
| 58 | c = len(val) |
| 59 | assert k.knapsack(cap, w, val, c, True) == 300 |
| 60 | |
| 61 | |
| 62 | if __name__ == "__main__": |
nothing calls this directly
no outgoing calls
no test coverage detected