##// END OF EJS Templates
tests: Fix mocking of get_scm and get_backend functions.
Martin Bornhold -
r488:c2409823 default
parent child Browse files
Show More
@@ -51,7 +51,7 b' def test_scm_instance_config(backend):'
51 def test__get_instance_config(backend):
51 def test__get_instance_config(backend):
52 repo = backend.create_repo()
52 repo = backend.create_repo()
53 vcs_class = Mock()
53 vcs_class = Mock()
54 with patch.multiple('rhodecode.model.db',
54 with patch.multiple('rhodecode.lib.vcs.backends',
55 get_scm=DEFAULT,
55 get_scm=DEFAULT,
56 get_backend=DEFAULT) as mocks:
56 get_backend=DEFAULT) as mocks:
57 mocks['get_scm'].return_value = backend.alias
57 mocks['get_scm'].return_value = backend.alias
@@ -59,13 +59,13 b' def test__get_instance_config(backend):'
59 with patch('rhodecode.model.db.Repository._config') as config_mock:
59 with patch('rhodecode.model.db.Repository._config') as config_mock:
60 repo._get_instance()
60 repo._get_instance()
61 vcs_class.assert_called_with(
61 vcs_class.assert_called_with(
62 repo.repo_full_path, config=config_mock, create=False,
62 repo_path=repo.repo_full_path, config=config_mock,
63 with_wire={'cache': True})
63 create=False, with_wire={'cache': True})
64
64
65 new_config = {'override': 'old_config'}
65 new_config = {'override': 'old_config'}
66 repo._get_instance(config=new_config)
66 repo._get_instance(config=new_config)
67 vcs_class.assert_called_with(
67 vcs_class.assert_called_with(
68 repo.repo_full_path, config=new_config, create=False,
68 repo_path=repo.repo_full_path, config=new_config, create=False,
69 with_wire={'cache': True})
69 with_wire={'cache': True})
70
70
71
71
General Comments 0
You need to be logged in to leave comments. Login now