Skip to content

chapter 4, service layer exercise, "decrement" should be "increment" in test names #48

Description

@iamdbychkov

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:

  1. 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?

  2. 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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions