@@ -211,7 +211,7 @@ def test_disabled_command_api():
211211 call is specified in the configuration for disabled project.
212212 """
213213 def mock_call_rest_api (command , b , http_headers = None , timeout = None , api_timeout = None ):
214- return mock (spec = requests .Response )
214+ return mock ({ "status_code" : 200 }, spec = requests .Response , strict = False )
215215
216216 with patch (opengrok_tools .utils .mirror .call_rest_api ,
217217 mock_call_rest_api ):
@@ -249,7 +249,7 @@ def mock_call_rest_api(call, b, http_headers=None, timeout=None, api_timeout=Non
249249 assert text
250250 assert text .find (text_to_append )
251251
252- return mock (spec = requests .Response )
252+ return mock ({ "status_code" : 200 }, spec = requests .Response , strict = False )
253253
254254 with monkeypatch .context () as m :
255255 m .setattr ("opengrok_tools.utils.mirror.call_rest_api" ,
@@ -302,7 +302,7 @@ def test_ignore_errors_sync(monkeypatch, per_project):
302302 Test that ignore errors overrides failed repository sync().
303303 """
304304
305- mock_repo = mock (spec = GitRepository )
305+ mock_repo = mock ({ "path" : "foo" }, spec = GitRepository , strict = False )
306306 when (mock_repo ).sync ().thenReturn (FAILURE_EXITVAL )
307307
308308 def mock_get_repos (* args , ** kwargs ):
@@ -338,7 +338,7 @@ def test_ignore_errors_hooks(monkeypatch, hook_type, per_project):
338338 """
339339
340340 def mock_get_repos (* args , ** kwargs ):
341- return [mock (spec = GitRepository )]
341+ return [mock ({ "path" : "foo" }, spec = GitRepository , strict = False )]
342342
343343 spy2 (opengrok_tools .utils .mirror .process_hook )
344344 project_name = "foo"
@@ -381,7 +381,7 @@ def test_disabled_command_run_args():
381381 """
382382 Make sure that run_command() calls Command.execute().
383383 """
384- cmd = mock (spec = Command )
384+ cmd = mock (spec = Command , strict = False )
385385 project_name = "foo"
386386 run_command (cmd , project_name )
387387 verify (cmd ).execute ()
0 commit comments