Skip to content

Commit 1a11320

Browse files
committed
Fix unit tests
1 parent 353d054 commit 1a11320

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

pact/pact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def _wait_for_server_start(self):
363363
"""
364364
s = requests.Session()
365365
retries = Retry(total=9, backoff_factor=0.1)
366-
http_mount = 'https://' if self._ssl else 'http://'
366+
http_mount = 'https://' if self.ssl else 'http://'
367367
s.mount(http_mount, HTTPAdapter(max_retries=retries))
368368

369369
resp = s.get(self.uri, headers=self.HEADERS, verify=False)

tests/test_pact.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,13 @@ def setUp(self):
375375
.will_respond_with(200, body='success'))
376376

377377
self.delete_call = call('delete', 'http://localhost:1234/interactions',
378-
headers={'X-Pact-Mock-Service': 'true'})
378+
headers={'X-Pact-Mock-Service': 'true'}, verify=False)
379379

380380
self.put_interactions_call = call(
381381
'put', 'http://localhost:1234/interactions',
382382
data=None,
383383
headers={'X-Pact-Mock-Service': 'true'},
384+
verify=False,
384385
json={'interactions': [{
385386
'response': {'status': 200, 'body': 'success'},
386387
'request': {'path': '/path', 'method': 'GET'},
@@ -570,7 +571,9 @@ def test_wait_for_server_start_success(self):
570571
session.mount.assert_called_once_with(
571572
'http://', self.mock_HTTPAdapter.return_value)
572573
session.get.assert_called_once_with(
573-
'http://localhost:1234', headers={'X-Pact-Mock-Service': 'true'})
574+
'http://localhost:1234',
575+
headers={'X-Pact-Mock-Service': 'true'},
576+
verify=False)
574577
self.mock_HTTPAdapter.assert_called_once_with(
575578
max_retries=self.mock_Retry.return_value)
576579
self.mock_Retry.assert_called_once_with(total=9, backoff_factor=0.1)
@@ -588,7 +591,9 @@ def test_wait_for_server_start_failure(self):
588591
session.mount.assert_called_once_with(
589592
'http://', self.mock_HTTPAdapter.return_value)
590593
session.get.assert_called_once_with(
591-
'http://localhost:1234', headers={'X-Pact-Mock-Service': 'true'})
594+
'http://localhost:1234',
595+
headers={'X-Pact-Mock-Service': 'true'},
596+
verify=False)
592597
self.mock_HTTPAdapter.assert_called_once_with(
593598
max_retries=self.mock_Retry.return_value)
594599
self.mock_Retry.assert_called_once_with(total=9, backoff_factor=0.1)
@@ -611,16 +616,17 @@ def setUp(self):
611616
'get', 'http://localhost:1234/interactions/verification',
612617
allow_redirects=True,
613618
headers={'X-Pact-Mock-Service': 'true'},
619+
verify=False,
614620
params=None)
615621

616622
self.post_publish_pacts_call = call(
617623
'post', 'http://localhost:1234/pact',
618624
data=None,
619625
headers={'X-Pact-Mock-Service': 'true'},
626+
verify=False,
620627
json=None)
621628

622629
def test_success(self):
623-
self.assertTrue(False)
624630
self.mock_requests.side_effect = iter([Mock(status_code=200)] * 2)
625631
self.target.verify()
626632

0 commit comments

Comments
 (0)