from buy_max_items import buy_max_items expected = 3 prices = [1, 12, 5, 14, 1000] output = buy_max_items(prices, 30) if output != expected: print("FAILED the following test:") print("buy_max_items(", prices, ", 30) returned", output, "should be", expected) expected = 0 prices = [11, 2 ,5, 7, 3] output = buy_max_items(prices, 1) if output != expected: print("FAILED the following test:") print("buy_max_items(", prices, ", 1) returned", output, "should be", expected) expected = 9 prices = [4, 10, 7, 9, 6, 15, 13, 12, 1, 5, 14, 11, 3, 8, 2] output = buy_max_items(prices, 45) if output != expected: print("FAILED the following test:") print("buy_max_items(", prices, ", 45) returned", output, "should be", expected) expected = 0 prices = [] # nothings for sale output = buy_max_items(prices, 100) if output != expected: print("FAILED the following test:") print("buy_max_items(", prices, ", 100) returned", output, "should be", expected)