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

Method test_base_case

knapsack/tests/test_knapsack.py:16–29  ·  view source on GitHub ↗

test for the base case

(self)

Source from the content-addressed store, hash-verified

14
15class Test(unittest.TestCase):
16 def test_base_case(self):
17 """
18 test for the base case
19 """
20 cap = 0
21 val = [0]
22 w = [0]
23 c = len(val)
24 assert k.knapsack(cap, w, val, c) == 0
25
26 val = [60]
27 w = [10]
28 c = len(val)
29 assert k.knapsack(cap, w, val, c) == 0
30
31 def test_easy_case(self):
32 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected