@@ -126,11 +126,11 @@ def test_start_fails(self):
126126 MOCK_SERVICE_PATH , 'start' ,
127127 '--host=localhost' ,
128128 '--port=1234' ,
129- '--log=" /logs/pact-mock-service.log" ' ,
130- '--pact-dir=" /pacts" ' ,
131- '--pact-specification-version=" 2.0.0" ' ,
132- '--consumer=" consumer" ' ,
133- '--provider=" provider" ' ])
129+ '--log' , ' /logs/pact-mock-service.log' ,
130+ '--pact-dir' , ' /pacts' ,
131+ '--pact-specification-version=2.0.0' ,
132+ '--consumer' , ' consumer' ,
133+ '--provider' , ' provider' ])
134134
135135 self .mock_Popen .return_value .communicate .assert_called_once_with ()
136136
@@ -143,11 +143,11 @@ def test_start_no_ssl(self):
143143 MOCK_SERVICE_PATH , 'start' ,
144144 '--host=localhost' ,
145145 '--port=1234' ,
146- '--log=" /logs/pact-mock-service.log" ' ,
147- '--pact-dir=" /pacts" ' ,
148- '--pact-specification-version=" 2.0.0" ' ,
149- '--consumer=" consumer" ' ,
150- '--provider=" provider" ' ])
146+ '--log' , ' /logs/pact-mock-service.log' ,
147+ '--pact-dir' , ' /pacts' ,
148+ '--pact-specification-version=2.0.0' ,
149+ '--consumer' , ' consumer' ,
150+ '--provider' , ' provider' ])
151151
152152 self .mock_Popen .return_value .communicate .assert_called_once_with ()
153153
@@ -161,14 +161,14 @@ def test_start_with_ssl(self):
161161 MOCK_SERVICE_PATH , 'start' ,
162162 '--host=localhost' ,
163163 '--port=1234' ,
164- '--log=" /logs/pact-mock-service.log" ' ,
165- '--pact-dir=" /pacts" ' ,
166- '--pact-specification-version=" 2.0.0" ' ,
167- '--consumer=" consumer" ' ,
168- '--provider=" provider" ' ,
164+ '--log' , ' /logs/pact-mock-service.log' ,
165+ '--pact-dir' , ' /pacts' ,
166+ '--pact-specification-version=2.0.0' ,
167+ '--consumer' , ' consumer' ,
168+ '--provider' , ' provider' ,
169169 '--ssl' ,
170- '--sslcert=" /ssl.cert" ' ,
171- '--sslkey=" /ssl.key" ' ])
170+ '--sslcert' , ' /ssl.cert' ,
171+ '--sslkey' , ' /ssl.key' ])
172172
173173 self .mock_Popen .return_value .communicate .assert_called_once_with ()
174174
@@ -196,8 +196,6 @@ def setUp(self):
196196 super (PactContextManagerTestCase , self ).setUp ()
197197 self .addCleanup (patch .stopall )
198198 self .mock_requests = patch ('requests.api.request' ).start ()
199- self .mock_start = patch .object (Pact , 'start' , autospec = True ).start ()
200- self .mock_stop = patch .object (Pact , 'stop' , autospec = True ).start ()
201199 self .consumer = Consumer ('TestConsumer' )
202200 self .provider = Provider ('TestProvider' )
203201 self .target = Pact (self .consumer , self .provider )
@@ -245,8 +243,6 @@ def test_successful(self):
245243 self .mock_requests .assert_has_calls ([
246244 self .delete_call , self .post_interactions_call ,
247245 self .get_verification_call , self .post_publish_pacts_call ])
248- self .mock_start .assert_called_once_with (self .target )
249- self .mock_stop .assert_called_once_with (self .target )
250246
251247 def test_error_deleting_interactions (self ):
252248 self .mock_requests .side_effect = iter ([
@@ -258,8 +254,6 @@ def test_error_deleting_interactions(self):
258254 self .assertEqual (str (e .exception ), 'deletion error' )
259255 self .assertEqual (self .mock_requests .call_count , 1 )
260256 self .mock_requests .assert_has_calls ([self .delete_call ])
261- self .mock_start .assert_called_once_with (self .target )
262- self .mock_stop .assert_called_once_with (self .target )
263257
264258 def test_error_posting_interactions (self ):
265259 self .mock_requests .side_effect = iter ([
@@ -273,14 +267,11 @@ def test_error_posting_interactions(self):
273267 self .assertEqual (self .mock_requests .call_count , 2 )
274268 self .mock_requests .assert_has_calls (
275269 [self .delete_call , self .post_interactions_call ])
276- self .mock_start .assert_called_once_with (self .target )
277- self .mock_stop .assert_called_once_with (self .target )
278270
279271 def test_error_raised (self ):
280272 self .mock_requests .side_effect = TypeError ('type error' )
281273 self .target .__exit__ (TypeError , 'type error' , Mock ())
282274 self .assertFalse (self .mock_requests .called )
283- self .mock_stop .assert_called_once_with (self .target )
284275
285276 def test_error_verifying_interactions (self ):
286277 self .mock_requests .side_effect = iter ([
@@ -293,7 +284,6 @@ def test_error_verifying_interactions(self):
293284 self .assertEqual (self .mock_requests .call_count , 1 )
294285 self .mock_requests .assert_has_calls ([
295286 self .get_verification_call ])
296- self .mock_stop .assert_called_once_with (self .target )
297287
298288 def test_error_writing_pacts_to_file (self ):
299289 self .mock_requests .side_effect = iter ([
@@ -307,7 +297,6 @@ def test_error_writing_pacts_to_file(self):
307297 self .assertEqual (self .mock_requests .call_count , 2 )
308298 self .mock_requests .assert_has_calls ([
309299 self .get_verification_call , self .post_publish_pacts_call ])
310- self .mock_stop .assert_called_once_with (self .target )
311300
312301
313302class FromTermsTestCase (TestCase ):
0 commit comments