@@ -211,7 +211,7 @@ def test_disabled_command_api():
211
211
call is specified in the configuration for disabled project.
212
212
"""
213
213
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 )
215
215
216
216
with patch (opengrok_tools .utils .mirror .call_rest_api ,
217
217
mock_call_rest_api ):
@@ -249,7 +249,7 @@ def mock_call_rest_api(call, b, http_headers=None, timeout=None, api_timeout=Non
249
249
assert text
250
250
assert text .find (text_to_append )
251
251
252
- return mock (spec = requests .Response )
252
+ return mock ({ "status_code" : 200 }, spec = requests .Response , strict = False )
253
253
254
254
with monkeypatch .context () as m :
255
255
m .setattr ("opengrok_tools.utils.mirror.call_rest_api" ,
@@ -302,7 +302,7 @@ def test_ignore_errors_sync(monkeypatch, per_project):
302
302
Test that ignore errors overrides failed repository sync().
303
303
"""
304
304
305
- mock_repo = mock (spec = GitRepository )
305
+ mock_repo = mock ({ "path" : "foo" }, spec = GitRepository , strict = False )
306
306
when (mock_repo ).sync ().thenReturn (FAILURE_EXITVAL )
307
307
308
308
def mock_get_repos (* args , ** kwargs ):
@@ -338,7 +338,7 @@ def test_ignore_errors_hooks(monkeypatch, hook_type, per_project):
338
338
"""
339
339
340
340
def mock_get_repos (* args , ** kwargs ):
341
- return [mock (spec = GitRepository )]
341
+ return [mock ({ "path" : "foo" }, spec = GitRepository , strict = False )]
342
342
343
343
spy2 (opengrok_tools .utils .mirror .process_hook )
344
344
project_name = "foo"
@@ -381,7 +381,7 @@ def test_disabled_command_run_args():
381
381
"""
382
382
Make sure that run_command() calls Command.execute().
383
383
"""
384
- cmd = mock (spec = Command )
384
+ cmd = mock (spec = Command , strict = False )
385
385
project_name = "foo"
386
386
run_command (cmd , project_name )
387
387
verify (cmd ).execute ()
0 commit comments