In chapter 4, we are challenged to implement a deallocation service, given a link with some stubs for tests and some complete e2e tests.
There are some inaccuracies with the exercies which I have found:
-
|
services.add_batch("b1", "BLUE-PLINTH", 100, None, repo, session) |
Test uses unexistent service add_batch. Shall we also implement it with tests? I would say yes. Maybe it worth to be included in the book itself?
-
|
services.allocate("o1", "BLUE-PLINTH", 10, repo, session) |
Invalid call for a service.allocate() function.
Unclear cases:
|
def test_deallocate_decrements_available_quantity(): |
|
def test_deallocate_decrements_correct_quantity(): |
What is an expected outcome of such functions? My intertpretation is that in first test we can deallocate any line with matching orderid and sku which is allocated. In the second test we deallocate the line with matching orderid, sku and qty. Is it correct?
In chapter 4, we are challenged to implement a deallocation service, given a link with some stubs for tests and some complete e2e tests.
There are some inaccuracies with the exercies which I have found:
code/test_services.py
Line 58 in 7efebb6
Test uses unexistent service
add_batch. Shall we also implement it with tests? I would say yes. Maybe it worth to be included in the book itself?code/test_services.py
Line 59 in 7efebb6
Invalid call for a service.allocate() function.
Unclear cases:
code/test_services.py
Line 56 in 7efebb6
code/test_services.py
Line 67 in 7efebb6
What is an expected outcome of such functions? My intertpretation is that in first test we can deallocate any line with matching
orderidandskuwhich is allocated. In the second test we deallocate the line with matchingorderid,skuandqty. Is it correct?