Skip to content

Commit de6b605

Browse files
author
Vladimir Kotal
committed
add the actual assertions
1 parent 7024be0 commit de6b605

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

opengrok-tools/src/test/python/test_mirror.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import requests
3535

3636
from opengrok_tools.scm.repofactory import get_repository
37+
from opengrok_tools.scm.git import GitRepository
3738
from opengrok_tools.utils.mirror import check_project_configuration, \
3839
check_configuration, mirror_project, run_command, get_repos_for_project, \
3940
HOOKS_PROPERTY, PROXY_PROPERTY, IGNORED_REPOS_PROPERTY, \
@@ -287,7 +288,8 @@ def test_get_repos_for_project(monkeypatch):
287288
"""
288289
project_name = 'foo'
289290
proxy_dict = {}
290-
commands = {}
291+
git_cmd_path = "/foo/git"
292+
commands = {"git": git_cmd_path}
291293
timeout = 314159
292294
test_repo = "/" + project_name
293295

@@ -311,11 +313,14 @@ def mock_get_repo_type(*args):
311313
commands=commands,
312314
proxy=proxy_dict,
313315
command_timeout=timeout)
314-
print(repos)
315316
assert len(repos) == 1
317+
assert isinstance(repos[0], GitRepository)
318+
git_repo = repos[0]
319+
assert git_repo.timeout == timeout
320+
assert git_repo.command == git_cmd_path
321+
assert git_repo.env == proxy_dict # XXX contains
316322

317323
# Now ignore the repository
318324
repos = get_repos_for_project(project_name, None, source_root,
319325
ignored_repos=['.'])
320-
print(repos)
321326
assert len(repos) == 0

0 commit comments

Comments
 (0)