GitHub
03/05/2023, 10:48 PMPACT_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
pact-foundation/pact-pythonMike Geeves
03/05/2023, 11:01 PMGitHub
03/06/2023, 10:21 AMpact-python
version 1.7.0.
There doesn't seem to be a way to verify with a specific pact by passing in a pact URL.
I tried passing a pact_url
kwarg into MessageProvider.verify_with_broker
but this always gives me the error pact.verify_wrapper.PactException: Pact urls or Pact broker required
.
pact-foundation/pact-pythonFacu Conejero
03/08/2023, 9:31 AMSerghei Iakovlev
03/10/2023, 9:57 AMGitHub
03/12/2023, 3:08 PMpact.Format.iso_8601_datetime()
method to match a string for a full ISO 8601 Date.
This method does not do any sort of date validation, only checks if the string is according to the ISO 8601 spec.
It differs from pact.Format.timestamp
, pact.Format.date
and pact.Format.time
implementations in that it is more stringent and tests the string for exact match to the ISO 8601 dates format.
Without with_ms
parameter will match string containing ISO 8601 formatted dates as stated bellow:
• 2016-12-15T201601
• 2010-05-01T011431.876
• 2016-05-24T155414.00000Z
• 1994-11-05T081530-05:00
• 2002-01-31T230000.1234-02:00
• 1991-02-20T063526.079043+00:00
Otherwise, ONLY dates with milliseconds will match the pattern:
• 2010-05-01T011431.876
• 2016-05-24T155414.00000Z
• 2002-01-31T230000.1234-02:00
• 1991-02-20T063526.079043+00:00
This change aims to bring the capabilities of the python library into alignment with pact-foundation/docs.pact.io#88, since the existing functionality is a bit liberal and allows tests to pass even in cases where the dates do not conform to the ISO 8601 spec.
pact-foundation/pact-python
GitHub Actions: build (3.10)
GitHub Actions: build (3.7)
✅ 3 other checks have passed
3/5 successful checksGitHub
03/12/2023, 10:28 PMChristine Awofeso
03/16/2023, 4:16 PMKripa Kurian
03/16/2023, 7:31 PMGitHub
03/17/2023, 10:26 AMUlises Cervino
03/22/2023, 9:01 PMQuinton Miller
03/23/2023, 7:21 PMverifiers.py
it says that the verify_with_broker function is supposed to return true if there are no issues. However, the readme shows that the function should return 0
. Which one is correct?Melike Sezin
03/28/2023, 2:02 PMGitHub
03/29/2023, 6:56 PMGitHub
03/29/2023, 6:56 PMbranch
• String buildUrl
• Boolean autoDetectVersionProperties
• Pass the new properties through to the pact-ruby-standalone publish command as:
• branch
as the --branch
property
• buildUrl
as`--build-url`
• autoDetectVersionProperties
as --auto-detect-version-properties
only if autoDetectVersionProperties is true
• To verify that this is working:
• publish a pact with a branch to a Pact Broker version 2.86.0+
• Open the index page
• Click on the integration
• You should see the pact that you have just published with a branch slug next to the consumer version number
• The build URL is currently only used in the webhook - as long as you can see it being passed through to the CLI, this should be sufficient.
pact-foundation/pact-pythonGitHub
03/29/2023, 6:58 PMGitHub
03/29/2023, 6:59 PMGitHub
03/29/2023, 7:38 PM<https://github.com/pact-foundation/pact-python/tree/master|master>
by sergeyklay
<https://github.com/pact-foundation/pact-python/commit/a219f49ce34c82b6b148e3c18b8c65219c8b234f|a219f49c>
- fix: actualize doc on how to make contributions
<https://github.com/pact-foundation/pact-python/commit/60f2aacf28f831004f65a860f6ad0eb5bab7a89f|60f2aacf>
- doc: correct links in contributing manual
<https://github.com/pact-foundation/pact-python/commit/bea156392d55f85111a44c179460e111d05a137a|bea15639>
- doc: improve commit messages guide
pact-foundation/pact-pythonGitHub
03/30/2023, 9:24 AMGitHub
03/30/2023, 9:35 AMGitHub
03/30/2023, 9:44 AMD:/python/Lib/site-packages/pact/bin/pact/lib/ruby/lib/ruby/2.2.0/logger.rb:513: warning: failed to load encoding (CP936); use ASCII-8BIT instead
D:/python/Lib/site-packages/pact/bin/pact/lib/ruby/lib/ruby/2.2.0/logger.rb:513: warning: failed to load encoding (CP936); use ASCII-8BIT instead
`
though it did generate a json file. But if I define error Expected deliberately in contract python file, when using pact-verifier in cmd, it shows:
```
`d\python\Lib\site packages\pact\bin\pact\lib\ruby\bin\..\bin.real\ruby.exe warning: failed to load encoding (CP936); use ASCII-8BIT instead
d\python\Lib\site packages\pact\bin\pact\lib\ruby\bin\..\bin.real\ruby.exe warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/2.2.0/rubygems.rb1028: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler/shared helpers.rb98: warning: failed to load encoding (CP936); use ASCII-8BIT i
nstead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d/python/Lib/site packages/pact/bin/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler 1.9.9/lib/bundler.rb13: warning: failed to load encoding (CP936); use ASCII-8BIT instead
d:/python/Lib/site-packages/pact/bin/pact/lib…
pact-foundation/pact-pythonGitHub
03/30/2023, 8:50 PMpact-verifier
, all I get is a bunch of SSL errors. pact-verifier
does not provide a way to disable SSL verification.
```
Failures:
1) Verifying a pact between consumer and provider Given A service is deployed A request for a service with GET /api/services/contract/test/my_service returns a response which has status code 200
Failure/Error: replay_interaction interaction
OpenSSL:SSLSSLError
SSL_connect returned=1 errno=0 state=error: certificate verify failed
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb923in `connect'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb923in `block in connect'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/ruby/lib/ruby/2.2.0/timeout.rb74in `timeout'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb923in `connect'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb863in `do_start'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb858in `start'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rack-proxy-0.6.1/lib/rack/http_streaming_response.rb71in `session'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rack-proxy-0.6.1/lib/rack/http_streaming_response.rb60in `response'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rack-proxy-0.6.1/lib/rack/http_streaming_response.rb29in `headers'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-proxy-2.1.0/vendor/rack-reverse-proxy/lib/rack/reverse_proxy.rb77in `proxy'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-proxy-2.1.0/vendor/rack-reverse-proxy/lib/rack/reverse_proxy.rb29in `call'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rack-test-0.6.3/lib/rack/mock_session.rb30in `request'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rack-test-0.6.3/lib/rack/test.rb244in `process_request'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rack-test-0.6.3/lib/rack/test.rb58in `get'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact-1.14.0/lib/pact/provider/test_methods.rb23in `replay_interaction'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact-1.14.0/lib/pact/provider/rspec.rb82in `block (4 levels) in describe_interaction'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact-1.14.0/lib/pact/provider/rspec.rb171in `run_once'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact-1.14.0/lib/pact/provider/rspec.rb79in `block (3 levels) in describe_interaction'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb447in `instance_exec'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb447in `instance_exec'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb350in `run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb507in `block in run_owned_hooks_for'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb506in `each'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb506in `run_owned_hooks_for'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb593in `block in run_example_hooks_for'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb592in `reverse_each'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb592in `run_example_hooks_for'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb462in `run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb494in `run_before_example'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb253in `block in run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb500in `block in with_around_and_singleton_context_hooks'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb457in `block in with_around_example_hooks'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb464in `block in run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb602in `run_around_example_hooks_for'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb464in `run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb457in `with_around_example_hooks'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb500in `with_around_and_singleton_context_hooks'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example.rb251in `run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb627in `block in run_examples'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb623in `map'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb623in `run_examples'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb589in `run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb590in `block in run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb590in `map'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb590in `run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb590in `block in run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb590in `map'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb590in `run'
# /usr/local/lib/python2.7/dist-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.6.0/lib/rspec/core/exampl…
pact-foundation/pact-pythonGitHub
03/30/2023, 8:55 PMrequest = requests.Request(
method=’POST’, url=’<http://localhost>’, json={‘test’: ‘a’})
prep = request.prepare()
signature = hmac.new(‘abc123’.encode('utf-8'),
msg=prep.body,
digestmod=hashlib.sha512).hexdigest()
prep.headers['Request-Signature'] = signature
resp = requests.session().send(prep)
return resp
And a Provider that verifies that HMAC:
@blueprint.route(‘/’, methods=[‘POST’])
def handle():
...
signature = hmac.new(
‘abc123’.encode(‘utf-8’),
msg=body,
digestmod=hashlib.sha512).hexdigest()
# if signature != request.headers.get('Request-Signature`):
# abort(401)
At the HTTP level, what is being sent from the Consumer is exactly:
‘{“status”: “e”}’
However, what is being received by the Provider is exactly:
‘{“status”:”e”}’
This would not be a problem under normal circumstances since the json encoder is ambivalent to whitespace. However, in the case of HMAC keys where the exact byte sequence of the request body is used it causes failures to authenticate.
The json contract spec that I get from running the Consumer unit tests is:
"interactions": [
{
"description": "<test request>",
"providerState": "<state>",
"request": {
"method": "post",
"path": "/",
"headers": {
"Content-Type": "application/json",
"Request-Signature": "<sig>"
},
"body": {
"test": "a"
}
},
"response": {
"status": 200,
"headers": {
},
"body": [
"Success",
200
]
}
},
…
]
}
pact-foundation/pact-pythonGokul Muralikrishnan
03/31/2023, 5:25 PMGitHub
03/31/2023, 8:36 PM<https://github.com/pact-foundation/pact-python/tree/master|master>
by sergeyklay
<https://github.com/pact-foundation/pact-python/commit/7603815b674a86c7cd243727f707c9466b6f738b|7603815b>
- ci: add python 3.11 to test matrix
<https://github.com/pact-foundation/pact-python/commit/4d9f4cd88f0b04a8afa38916386daeeff7942412|4d9f4cd8>
- feat: describe classifiers and python version for pypi package
<https://github.com/pact-foundation/pact-python/commit/348bf5e41c9b4df8e68a66e6d1896a7a8f78c608|348bf5e4>
- build: use compatible dependency versions for Python 3.6
<https://github.com/pact-foundation/pact-python/commit/f7c50063019c096b5507a45582a693a5a8cfbea6|f7c50063>
- docs: add Python 3.11 to CONTRIBUTING.md
pact-foundation/pact-pythonGitHub
03/31/2023, 8:36 PMtox -e py311
it was related to an old coverage
version, so updated it to a newer one, where it was fixed 🙂
pact-foundation/pact-python
✅ All checks have passed
1/1 successful checksGitHub
04/02/2023, 7:44 PM<https://github.com/pact-foundation/pact-python/tree/master|master>
by sergeyklay
<https://github.com/pact-foundation/pact-python/commit/26eaaac2e326b57fb9413d440ecd7f7c065d0783|26eaaac2>
- fix: remove dead code
<https://github.com/pact-foundation/pact-python/commit/28fc7d3e499fd203280edc4c3a901be765c6496d|28fc7d3e>
- docs: fix link for GitHub badge
pact-foundation/pact-pythonGitHub
04/02/2023, 10:07 PM<https://github.com/pact-foundation/pact-python/tree/master|master>
by sergeyklay
<https://github.com/pact-foundation/pact-python/commit/55dcaf25779aae4b68c307c88ce640fd6ab17ae6|55dcaf25>
- feat(test): add docker images for Python 3.9-3.11 for testing purposes
<https://github.com/pact-foundation/pact-python/commit/24c2dbf1437e1aa5937153f40b80498dea06b3d0|24c2dbf1>
- docs: fix instruction to build python 3.11 image
<https://github.com/pact-foundation/pact-python/commit/a5d3a2e689f3cf0a9c4624233feae0a77382cf10|a5d3a2e6>
- docs: paraphrase the instructions for running the tests
<https://github.com/pact-foundation/pact-python/commit/e99e7fb0fa4abce69c9cfcd47eb9e3afe0351681|e99e7fb0>
- docs: rephrase the instructions for running the tests
pact-foundation/pact-pythonMatt (pactflow.io / pact-js / pact-go)
GitHub
04/03/2023, 6:24 AMPACT_EXECUTING_LANGUAGE
to python
• PACT_EXECUTING_LANGUAGE_VERSION
to the version of running python environment (e.g. 3.11
).
See example PR here: pact-foundation/pact-js-core#359
pact-foundation/pact-python