Exemple #1
0
 def test_too_many_entries(self):
     test_products = list()
     for i in range(0, 17):
         test_products.append(Product('ccc33', i))
     test_list_server = ListServer(test_products)
     with self.assertRaises(TooManyProductFoundError):
         test_list_server.get_entries(3)
Exemple #2
0
 def test_get_entries(self):
     test_list_server = ListServer()
     p1 = Product('abc44', 222.3)
     p2 = Product('ab33', 17.23)
     test_list_server.catalog.append(p1)
     test_list_server.catalog.append(p2)
     entries = test_list_server.get_entries(3)
     self.assertEqual(Counter([p1]), Counter(entries))