MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / test_knapsack_repetition

Method test_knapsack_repetition

knapsack/tests/test_knapsack.py:51–59  ·  view source on GitHub ↗

test for the knapsack repetition

(self)

Source from the content-addressed store, hash-verified

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
62if __name__ == "__main__":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected