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

Method test_sorted

knapsack/tests/test_greedy_knapsack.py:13–21  ·  view source on GitHub ↗

kp.calc_profit takes the required argument (profit, weight, max_weight) and returns whether the answer matches to the expected ones

(self)

Source from the content-addressed store, hash-verified

11 """
12
13 def test_sorted(self):
14 """
15 kp.calc_profit takes the required argument (profit, weight, max_weight)
16 and returns whether the answer matches to the expected ones
17 """
18 profit = [10, 20, 30, 40, 50, 60]
19 weight = [2, 4, 6, 8, 10, 12]
20 max_weight = 100
21 assert kp.calc_profit(profit, weight, max_weight) == 210
22
23 def test_negative_max_weight(self):
24 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected