Skip to content

Commit 69a4a9a

Browse files
Merge pull request #163 from elliottmurray/fix/custom_header
fix: custom headers had a typo
2 parents f501f19 + 88b7d9f commit 69a4a9a

File tree

3 files changed

+83
-2
lines changed

3 files changed

+83
-2
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"consumer": {
3+
"name": "PythonClient"
4+
},
5+
"provider": {
6+
"name": "PythonService"
7+
},
8+
"interactions": [
9+
{
10+
"description": "a request for UserA",
11+
"providerState": "UserA exists and is not an administrator",
12+
"request": {
13+
"method": "get",
14+
"path": "/users/UserA"
15+
},
16+
"response": {
17+
"status": 200,
18+
"headers": {
19+
},
20+
"body": {
21+
"json_class": "Pact::SomethingLike",
22+
"contents": {
23+
"name": "UserA",
24+
"id": {
25+
"json_class": "Pact::Term",
26+
"data": {
27+
"generate": "fc763eba-0905-41c5-a27f-3934ab26786c",
28+
"matcher": {
29+
"json_class": "Regexp",
30+
"o": 0,
31+
"s": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
32+
}
33+
}
34+
},
35+
"created_on": {
36+
"json_class": "Pact::Term",
37+
"data": {
38+
"generate": "2016-12-15T20:16:01",
39+
"matcher": {
40+
"json_class": "Regexp",
41+
"o": 0,
42+
"s": "\\d+-\\d+-\\d+T\\d+:\\d+:\\d+"
43+
}
44+
}
45+
},
46+
"ip_address": {
47+
"json_class": "Pact::Term",
48+
"data": {
49+
"generate": "127.0.0.1",
50+
"matcher": {
51+
"json_class": "Regexp",
52+
"o": 0,
53+
"s": "(\\d{1,3}\\.)+\\d{1,3}"
54+
}
55+
}
56+
},
57+
"admin": false
58+
}
59+
}
60+
}
61+
},
62+
{
63+
"description": "a request for UserA",
64+
"providerState": "UserA does not exist",
65+
"request": {
66+
"method": "get",
67+
"path": "/users/UserA"
68+
},
69+
"response": {
70+
"status": 404,
71+
"headers": {
72+
}
73+
}
74+
}
75+
],
76+
"metadata": {
77+
"pactSpecification": {
78+
"version": "1.0.0"
79+
}
80+
}
81+
}

pact/cli/verify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def main(pacts, base_url, pact_url, pact_urls, states_url, states_setup_url,
156156
'log_dir': log_dir,
157157
'log_level': log_level,
158158
'provider_app_version': provider_app_version,
159-
'custom_provider_header': list(headers),
159+
'custom_provider_headers': list(headers),
160160
'timeout': timeout,
161161
'verbose': verbose,
162162
'consumer_tags': list(consumer_version_tag),

tests/cli/test_verify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def test_all_url_options(self, mock_isfile, mock_wrapper):
241241
broker_token='token',
242242
broker_url='http://localhost/docker',
243243
provider_app_version='1.2.3',
244-
custom_provider_header=['Authorization: Basic cGFj', 'CustomHeader: somevalue'],
244+
custom_provider_headers=['Authorization: Basic cGFj', 'CustomHeader: somevalue'],
245245
provider_states_setup_url='http://localhost/provider-states/set',
246246
log_dir='tmp/logs/pact.test.log',
247247
log_level='INFO',

0 commit comments

Comments
 (0)