diff options
-rw-r--r-- | src/buildstream/testing/_utils/junction.py | 5 | ||||
-rw-r--r-- | tests/frontend/mirror.py | 4 | ||||
-rw-r--r-- | tests/sources/git.py | 10 | ||||
-rw-r--r-- | tests/testutils/repo/git.py | 5 |
4 files changed, 15 insertions, 9 deletions
diff --git a/src/buildstream/testing/_utils/junction.py b/src/buildstream/testing/_utils/junction.py index ca059eb8b..2bf53ac7c 100644 --- a/src/buildstream/testing/_utils/junction.py +++ b/src/buildstream/testing/_utils/junction.py @@ -60,7 +60,10 @@ class _SimpleGit(Repo): universal_newlines=True, ).stdout.strip() - def source_config(self, ref=None, checkout_submodules=None): + def source_config(self, ref=None): + return self.source_config_extra(ref) + + def source_config_extra(self, ref=None, checkout_submodules=None): config = { 'kind': 'git', 'url': 'file://' + self.repo, diff --git a/tests/frontend/mirror.py b/tests/frontend/mirror.py index f7427cf88..09beb38b8 100644 --- a/tests/frontend/mirror.py +++ b/tests/frontend/mirror.py @@ -427,7 +427,7 @@ def test_mirror_fallback_git_only_submodules(cli, tmpdir, datafiles): element = { 'kind': 'import', 'sources': [ - main_repo.source_config(ref=main_ref, checkout_submodules=True) + main_repo.source_config_extra(ref=main_ref, checkout_submodules=True) ] } element_name = 'test.bst' @@ -522,7 +522,7 @@ def test_mirror_fallback_git_with_submodules(cli, tmpdir, datafiles): element = { 'kind': 'import', 'sources': [ - upstream_main_repo.source_config(ref=upstream_main_ref, checkout_submodules=True) + upstream_main_repo.source_config_extra(ref=upstream_main_ref, checkout_submodules=True) ] } element['sources'][0]['url'] = aliased_repo diff --git a/tests/sources/git.py b/tests/sources/git.py index e9cc369d7..e01477c49 100644 --- a/tests/sources/git.py +++ b/tests/sources/git.py @@ -128,7 +128,7 @@ def test_submodule_fetch_source_enable_explicit(cli, tmpdir, datafiles): element = { 'kind': 'import', 'sources': [ - repo.source_config(ref=ref, checkout_submodules=True) + repo.source_config_extra(ref=ref, checkout_submodules=True) ] } _yaml.dump(element, os.path.join(project, 'target.bst')) @@ -167,7 +167,7 @@ def test_submodule_fetch_source_disable(cli, tmpdir, datafiles): element = { 'kind': 'import', 'sources': [ - repo.source_config(ref=ref, checkout_submodules=False) + repo.source_config_extra(ref=ref, checkout_submodules=False) ] } _yaml.dump(element, os.path.join(project, 'target.bst')) @@ -206,7 +206,7 @@ def test_submodule_fetch_submodule_does_override(cli, tmpdir, datafiles): element = { 'kind': 'import', 'sources': [ - repo.source_config(ref=ref, checkout_submodules=False) + repo.source_config_extra(ref=ref, checkout_submodules=False) ] } _yaml.dump(element, os.path.join(project, 'target.bst')) @@ -250,7 +250,7 @@ def test_submodule_fetch_submodule_individual_checkout(cli, tmpdir, datafiles): element = { 'kind': 'import', 'sources': [ - repo.source_config(ref=ref, checkout_submodules=True) + repo.source_config_extra(ref=ref, checkout_submodules=True) ] } _yaml.dump(element, os.path.join(project, 'target.bst')) @@ -295,7 +295,7 @@ def test_submodule_fetch_submodule_individual_checkout_explicit(cli, tmpdir, dat element = { 'kind': 'import', 'sources': [ - repo.source_config(ref=ref, checkout_submodules=True) + repo.source_config_extra(ref=ref, checkout_submodules=True) ] } _yaml.dump(element, os.path.join(project, 'target.bst')) diff --git a/tests/testutils/repo/git.py b/tests/testutils/repo/git.py index 0ed0590be..ba1590273 100644 --- a/tests/testutils/repo/git.py +++ b/tests/testutils/repo/git.py @@ -72,7 +72,10 @@ class Git(Repo): self._run_git('commit', '-m', 'Removing {}'.format(path)) return self.latest_commit() - def source_config(self, ref=None, checkout_submodules=None): + def source_config(self, ref=None): + return self.source_config_extra(ref) + + def source_config_extra(self, ref=None, checkout_submodules=None): config = { 'kind': 'git', 'url': 'file://' + self.repo, |