@@ -18,31 +18,27 @@ def list(self):
1818
1919
2020class FakeUnitOfWork (unit_of_work .AbstractUnitOfWork ):
21- def __init__ (self ):
22- self .batches = FakeRepository ([])
23- self .committed = False
24-
25- def commit (self ):
26- self .committed = True
27-
28- def rollback (self ):
29- pass
21+ ...
3022
3123
3224def test_add_batch ():
3325 uow = FakeUnitOfWork ()
34- services .add_batch ("b1" , "CRUNCHY-ARMCHAIR" , 100 , None , uow )
26+ # fake_uow_starter = FakeUoWContextManager(uow) ?
27+ # fake_uow_starter = contextlib.nullcontext(uow) ?
28+ # services.add_batch("b1", "CRUNCHY-ARMCHAIR", 100, None, fake_uow_starter)
3529 assert uow .batches .get ("b1" ) is not None
3630 assert uow .committed
3731
3832
33+ @pytest .mark .skip ("unskip and fix when ready" )
3934def test_allocate_returns_allocation ():
4035 uow = FakeUnitOfWork ()
4136 services .add_batch ("batch1" , "COMPLICATED-LAMP" , 100 , None , uow )
4237 result = services .allocate ("o1" , "COMPLICATED-LAMP" , 10 , uow )
4338 assert result == "batch1"
4439
4540
41+ @pytest .mark .skip ("unskip and fix when ready" )
4642def test_allocate_errors_for_invalid_sku ():
4743 uow = FakeUnitOfWork ()
4844 services .add_batch ("b1" , "AREALSKU" , 100 , None , uow )
@@ -51,6 +47,7 @@ def test_allocate_errors_for_invalid_sku():
5147 services .allocate ("o1" , "NONEXISTENTSKU" , 10 , uow )
5248
5349
50+ @pytest .mark .skip ("unskip and fix when ready" )
5451def test_allocate_commits ():
5552 uow = FakeUnitOfWork ()
5653 services .add_batch ("b1" , "OMINOUS-MIRROR" , 100 , None , uow )
0 commit comments