Skip to content

JSON subset matching #133

@sarayourfriend

Description

@sarayourfriend

It would be nice to be able to match request body JSON using an expected subset of the data. Something like:

(pook.post(url)
    .json({"id": identifier}, subset=True)
    .reply(200))

As a way to match a larger request body that's:

{
  "id": ...,
  "created_on": ...,
  "updated_on": ...,
  "other_property_irrelevant_to_the_test": ...,
}

Right now the only way to do this is using a regex pattern with the body matcher, but that's pretty tedious, especially if you have multiple subset properties you want to test.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions