示例#1
0
 def test_example_input_hardcoded(self):
     money = 4
     cost = [1, 4, 5, 3, 2]
     result = whatFlavors(cost, money)
     assert result == "1 4"
     money2 = 4
     cost2 = [2, 2, 4, 3]
     result2 = whatFlavors(cost2, money2)
     assert result2 == "1 2"
示例#2
0
 def test_harder_example(self):
     """
     this one requires a restart
     """
     money = 4
     cost = [1, 2, 2]
     result = whatFlavors(cost, money)
     assert result == "2 3"
示例#3
0
 def test_big_example1(self):
     with open('ice_cream_testcase.txt', 'r') as f:
         num_trips = int(f.readline())
         assert num_trips == 34
         money = int(f.readline())
         assert money == 585167982
         cost_len = int(f.readline())
         assert cost_len == 21617
         for i in range(1):  #(num_trips):
             trip = list(map(int, f.readline().rstrip().split()))
             assert len(trip) == cost_len
             result = whatFlavors(trip, money)
             print(result)
示例#4
0
 def test_sample_test2b(self):
     money = 12
     cost = [7, 2, 5, 4, 11]
     result = whatFlavors(cost, money)
     assert result == "1 3"
示例#5
0
 def test_sample_test2a(self):
     money = 8
     cost = [4, 3, 2, 5, 7]
     result = whatFlavors(cost, money)
     assert result == "2 4"