示例#1
0
    def test_print_items_in_cart(self):
        list = self.generate_data()
        store = Store(list)

        for each_item in list:
            store.add_cart(each_item, 1)
        print_items_in_cart(store)
        self.assertEqual(list, store.get_cart_items())
示例#2
0
    def test_remove_item_from_cart(self):
        list = self.generate_data()

        expected_remove_list = []
        for each_item in list:
            expected_remove_list.append(each_item)
        toBeRemoved = expected_remove_list[0]
        del expected_remove_list[0]
        store = Store(list)

        for each_item in list:
            store.add_cart(each_item, 1)
        store.remove_from_cart(toBeRemoved)
        self.assertEqual(expected_remove_list, store.get_cart_items())