Hi folks, we're experimenting with a Pact POC for...
# pact-python
b
Hi folks, we're experimenting with a Pact POC for our python microservices. More specifically we are trying to run the verification for the provider against a flask test_client instead of against a live server, but this seems not possible (yet)? The flask test client makes requests to the application without running a live server. You can test the client programmatically by calling
response = test_client.get()
,
response = <http://test_client.post|test_client.post>()
, ... Using this test client has some advantages compared to running a local server: it's faster, it makes it easier to mock dependent services (like databases), it makes it very easy to deal with authentication etc... But as far as I can see the only way of verifying a provider contract is with the standalone pact-verifier tool (or a wrapper around the tool), where you need to pass a provider-base-url which points to a live server?
m
That’s right, at the moment, the verifier must be able to connect to the HTTP server to do the verification. It is possible to do, albeit
pact-python
would need to start an HTTP server and route traffic to the flask test client (so it will always need an HTTP endpoint, just whether or not
pact-python
provides it, or the user)
👍 1