def test_optimal_total_cost_calculates_correctly(): raw_costs = get_raw_costs() demand = get_demand() trc = EOQ.optimal_relevant_cost(raw_costs, demand) expected = trc + raw_costs.unit_cost * demand.quantity actual = EOQ.optimal_total_cost(raw_costs=raw_costs, demand=demand) assert expected == actual
def test_optimal_total_cost_with_missing_demand_raises(): with pytest.raises(ValueError): EOQ.optimal_total_cost(raw_costs=get_raw_costs(), demand=None)