diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-09-18 17:26:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-09-18 17:26:51 +0000 |
commit | fdfc46d13c6703f796749af8920f9f0aefd05c78 (patch) | |
tree | be799991c6f95f233d9dbe1b87b350ab225d41c9 /tests | |
parent | Releasing debian version 0.15.7-1. (diff) | |
download | gita-fdfc46d13c6703f796749af8920f9f0aefd05c78.tar.xz gita-fdfc46d13c6703f796749af8920f9f0aefd05c78.zip |
Merging upstream version 0.15.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/test_utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index 3ff0cb1..65096e9 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -10,6 +10,19 @@ from conftest import ( ) +@pytest.mark.parametrize('input, expected', [ + ([], ({'repo1': {'path': '/a/bcd/repo1', 'type': '', 'flags': []}, 'xxx': {'path': '/a/b/c/repo3', 'type': '', 'flags': []}, 'repo2': {'path': '/e/fgh/repo2', 'type': '', 'flags': []}}, [])), + (['st'], ({'repo1': {'path': '/a/bcd/repo1', 'type': '', 'flags': []}, 'xxx': {'path': '/a/b/c/repo3', 'type': '', 'flags': []}, 'repo2': {'path': '/e/fgh/repo2', 'type': '', 'flags': []}}, ['st'])), + (['repo1', 'st'], ({'repo1': {'flags': [], 'path': '/a/bcd/repo1', 'type': ''}}, ['st'])), + (['repo1'], ({'repo1': {'flags': [], 'path': '/a/bcd/repo1', 'type': ''}}, [])), + ]) +@patch('gita.utils.is_git', return_value=True) +@patch('gita.common.get_config_fname', return_value=PATH_FNAME) +def test_parse_repos_and_rest(mock_path_fname, _, input, expected): + got = utils.parse_repos_and_rest(input) + assert got == expected + + @pytest.mark.parametrize('repo_path, paths, expected', [ ('/a/b/c/repo', ['/a/b'], (('b', 'c'), '/a')), ]) |