Skip to content

Commit 6876e75

Browse files
committed
update tests
1 parent 916bcdd commit 6876e75

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tests/integration/test_uow.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,25 @@ def test_uow_can_retrieve_a_batch_and_allocate_to_it(session_factory):
2929
insert_batch(session, "batch1", "HIPSTER-WORKBENCH", 100, None)
3030
session.commit()
3131

32-
uow = unit_of_work.SqlAlchemyUnitOfWork(session_factory)
33-
with uow:
34-
batch = uow.batches.get(reference="batch1")
35-
line = model.OrderLine("o1", "HIPSTER-WORKBENCH", 10)
36-
batch.allocate(line)
37-
uow.commit()
32+
pytest.fail("decide what your UoW looks like first?")
33+
# either:
34+
# uow = unit_of_work.SqlAlchemyUnitOfWork(session_factory)
35+
# with uow:
36+
37+
# or perhaps
38+
# with unit_of_work.start(session_factory) as uow: ?
39+
40+
# batch = uow.batches.get(reference='batch1')
41+
# line = model.OrderLine('o1', 'HIPSTER-WORKBENCH', 10)
42+
# batch.allocate(line)
43+
# uow.commit()
3844

3945
batchref = get_allocated_batch_ref(session, "o1", "HIPSTER-WORKBENCH")
4046
assert batchref == "batch1"
4147

4248

49+
"""
50+
# uncomment and fix these when ready
4351
def test_rolls_back_uncommitted_work_by_default(session_factory):
4452
uow = unit_of_work.SqlAlchemyUnitOfWork(session_factory)
4553
with uow:
@@ -63,3 +71,4 @@ class MyException(Exception):
6371
new_session = session_factory()
6472
rows = list(new_session.execute('SELECT * FROM "batches"'))
6573
assert rows == []
74+
"""

0 commit comments

Comments
 (0)