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

Method test_null_max_weight

knapsack/tests/test_greedy_knapsack.py:53–61  ·  view source on GitHub ↗

Returns ValueError for any zero max_weight value :return: ValueError

(self)

Source from the content-addressed store, hash-verified

51 pytest.raises(ValueError, match=r"Profit can not be negative.")
52
53 def test_null_max_weight(self):
54 """
55 Returns ValueError for any zero max_weight value
56 :return: ValueError
57 """
58 # profit = [10, 20, 30, 40, 50, 60]
59 # weight = [2, 4, 6, 8, 10, 12]
60 # max_weight = null
61 pytest.raises(ValueError, match=r"max_weight must greater than zero.")
62
63 def test_unequal_list_length(self):
64 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected