Skip to content
Open
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
9a74b16
makefile for running stuff
hjwp Feb 8, 2019
5be7bcf
first test [first_test]
hjwp Mar 8, 2019
fc5811e
first stab at a model [domain_model_1]
hjwp Mar 8, 2019
108a74c
more tests for can_allocate [test_can_allocate]
hjwp Mar 8, 2019
d817ecd
can_allocate fn [can_allocate]
hjwp Mar 8, 2019
bd0e75e
simple deallocate test
hjwp Mar 8, 2019
8ad3236
simple deallocate function
hjwp Mar 8, 2019
bebd0fd
test deallocate not allocated [test_deallocate_unallocated]
hjwp Mar 8, 2019
b2d618a
model now tracks allocations [domain_model_complete]
hjwp Mar 8, 2019
ad26a08
test allocate twice [last_test]
hjwp Mar 8, 2019
235e121
equality and hash operators [equality_on_batches]
hjwp Mar 8, 2019
d1dda70
new tests for allocate domain service [test_allocate]
hjwp Mar 9, 2019
8a6ec0e
allocate fn, domain service [domain_service]
hjwp Mar 9, 2019
ff0a15c
fixup a batchref
hjwp Jul 18, 2019
0c3b87e
change tests add one for return
hjwp Mar 20, 2019
07dd382
make Batches sortable [dunder_gt]
hjwp Mar 9, 2019
18aa3b4
fixup a sku
hjwp Jul 18, 2019
d75eaf7
test out of stock exception [test_out_of_stock]
hjwp Mar 11, 2019
184d90d
raising out of stock exception [out_of_stock]
hjwp Mar 11, 2019
73dae3f
add readme from master
hjwp Jul 1, 2019
5b77fc4
Wrong path in venv creation line
karolpawlowski Feb 1, 2021
3e9871d
travis config. [chapter_01_domain_model_ends]
hjwp Mar 26, 2019
58d05e4
first cut of orm, orderlines only [sqlalchemy_classical_mapper]
hjwp Mar 10, 2019
ef7a621
first tests of orm [orm_tests]
hjwp Mar 10, 2019
527b320
unfortunate hack on dataclass in model
hjwp Mar 10, 2019
26b997e
batches with no allocations
hjwp Mar 10, 2019
fff68bd
ORM for _allocations set on Batch
hjwp Mar 11, 2019
8dae126
repository tests
hjwp Mar 11, 2019
b635a15
repository for batches [chapter_02_repository_ends]
hjwp Mar 11, 2019
fda077d
first api tests [first_api_test]
hjwp Mar 11, 2019
15902a6
all the dockerfile gubbins
hjwp Mar 19, 2019
8fc086e
first cut of flask app [first_cut_flask_app]
hjwp Mar 11, 2019
158e760
test persistence by double-allocating. [second_api_test]
hjwp Mar 19, 2019
d0ee7ad
need to commit [flask_commit]
hjwp Mar 19, 2019
f20c479
test some 400 error cases [test_error_cases]
hjwp Mar 19, 2019
80dece9
flask now does error handling [flask_error_handling]
hjwp Mar 19, 2019
a1903fa
first tests for the services layer [first_services_tests]
hjwp Mar 19, 2019
9fe9a3d
FakeRepository [fake_repo]
hjwp Jan 3, 2020
15b9bf7
FakeSession [fake_session]
hjwp Jan 3, 2020
eded7eb
test commmits [second_services_test]
hjwp Apr 23, 2019
d1e2e6e
services layer with valid-sku check [service_function]
hjwp Mar 19, 2019
cf2f52b
modify flask app to use service layer [flask_app_using_service_layer]
hjwp Mar 19, 2019
b537364
strip out unecessary tests from e2e layer [fewer_e2e_tests]
hjwp Mar 19, 2019
952a3d2
fix conftest waits and travis config [chapter_04_service_layer_ends]
hjwp Mar 26, 2019
bdf8fe9
move to a more nested folder structure
hjwp Dec 23, 2019
1bb572a
nest the tests too
hjwp Dec 31, 2019
db89218
get all tests passing
hjwp Dec 31, 2019
c5822aa
rewrite service layer to take primitives [service_takes_primitives]
hjwp Apr 23, 2019
f341bee
services tests partially converted to primitives [tests_call_with_pri…
hjwp Apr 23, 2019
1e1f238
fixture function for batches [services_factory_function]
hjwp Apr 23, 2019
5c953da
new service to add a batch [add_batch_service]
hjwp Apr 23, 2019
262eec0
service-layer test for add batch [test_add_batch]
hjwp Apr 23, 2019
c8fbb60
all service-layer tests now services [services_tests_all_services]
hjwp Apr 23, 2019
96301d2
modify flask app to use new service layer api [api_uses_modified_serv…
hjwp Apr 23, 2019
6b404b5
add api endpoint for add_batch [api_for_add_batch]
hjwp Apr 24, 2019
fd45a6f
api tests no longer need hardcoded sql fixture [chapter_05_high_gear_…
hjwp Apr 24, 2019
d9c340c
start moving files into src folder and add setup.py
hjwp Feb 27, 2019
c843a10
fix all the imports, get it all working
hjwp Feb 27, 2019
12d2bc2
get tests working in docker container
hjwp Feb 27, 2019
28afa9a
make mypy slightly stricter
hjwp May 23, 2019
53ad798
better requirements.txt [appendix_project_structure_ends]
hjwp Mar 11, 2019
833d48b
basic uow test, uow and conftest.py changes
hjwp Mar 11, 2019
658e61a
use uow in services, flask app
hjwp Mar 20, 2019
7526014
two more tests for rollback behaviour [chapter_06_uow_ends]
hjwp Mar 12, 2019
916bcdd
strip out UoW and fake UoW, add some tips
hjwp Jun 28, 2019
6876e75
update tests
hjwp Jun 28, 2019
00f1574
fix: SQLAlchemy 2.0 compatibility for chapter_06_uow_exercise
rickywesker Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test commmits [second_services_test]
  • Loading branch information
hjwp committed Feb 24, 2021
commit eded7ebf6cc5f0fb05dc547af6daee6549e171ca
10 changes: 10 additions & 0 deletions test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,13 @@ def test_error_for_invalid_sku():

with pytest.raises(services.InvalidSku, match="Invalid sku NONEXISTENTSKU"):
services.allocate(line, repo, FakeSession())


def test_commits():
line = model.OrderLine("o1", "OMINOUS-MIRROR", 10)
batch = model.Batch("b1", "OMINOUS-MIRROR", 100, eta=None)
repo = FakeRepository([batch])
session = FakeSession()

services.allocate(line, repo, session)
assert session.committed is True