pact-python
pact-python copied to clipboard
Examples: remove misleading use of PACT_MOCK variables in examples
The fastapi example (and perhaps the others) are a little misleading to newbies.
The following lines would suggest that there is pact mock on the provider side, when in reality this is the address of the locally running FastAPI provider:
PACT_MOCK_HOST = 'localhost'
PACT_MOCK_PORT = 8000
PACT_URL = "http://{}:{}".format(PACT_MOCK_HOST, PACT_MOCK_PORT)
I'd suggest changing these to PROVIDER_HOST, PROVIDER_PORT and PROVIDER_URL respectively, perhaps with a comment explaining these map to the default host/port combination of the provider.
See this thread for context: https://pact-foundation.slack.com/archives/C9VECUP6E/p1633686950075000
I think this one should be ok to close off now, note the file is now at: https://github.com/pact-foundation/pact-python/blob/master/examples/fastapi_provider/tests/provider/test_provider.py
/cc @elliottmurray
I think this is good to close now.