internap / python-mockserver-friendly-client

Friendly python client to James D. Bloom's awesome MockServer
Apache License 2.0
14 stars 12 forks source link

Expect/Verify Expectations No Longer Works #23

Open garnesen opened 4 years ago

garnesen commented 4 years ago

Mockserver-friendly-client calls verify with:

{
    "httpRequest": {...},
    "times": {
        "exact": true,
        "count": self.count
    }
}

But MockServer expects:

{
    "httpRequest": {...},
    "times": {
        "atLeast": true
        "atMost": self.count
    }
}

Verify documentation

I suggest changing https://github.com/internap/python-mockserver-friendly-client/blob/900f5ab6db6c38ba48669522d5d1b070b049f25e/mockserver_friendly/__init__.py#L107-L108 to return {"atLeast": self.count, "atMost": self.count}

lindycoder commented 4 years ago

I think it's because the API changed at one point, this repo currently supports jamesdbloom/mockserver:mockserver-5.4.1.

I think it'd be nice to support new versions but we'd need either to instruct the client on the server's version or have a different tag/branch for new versions.

garnesen commented 4 years ago

IMO it makes the most sense to update to a new major or minor version to signify breaking changes. MockServer 5.4.1 was released in June of 2018, and is now up to 5.10.0. It would be great to update the library to use the latest version of MockServer. I can create a PR to update to the latest version if you'd prefer.

lindycoder commented 4 years ago

Please do, we could probably tag 0.4.0 with it