Esempio n. 1
0
 def test_remove(self):
     repository = InMemoryProductRepository()
     product = Product(name='The Last of Us Part II',
                       sku='AHJU-49685',
                       cost=10.00,
                       price=220.00,
                       inventory_quantity=150)
     product_id = repository.add(product)
     repository.remove(product_id)
     with self.assertRaises(NotFound):
         repository.get_by_id(product_id)
Esempio n. 2
0
 def test_remove_should_raise_not_found_when_cant_find_product(self):
     repository = InMemoryProductRepository()
     with self.assertRaises(NotFound):
         repository.remove(1)