This is an automated email from the ASF dual-hosted git repository. tvb pushed a commit to branch tristan/remove-sip-zource in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 1c3466f2e698c381bbe8d8cd6edbb05036d448b5 Author: Tristan van Berkom <[email protected]> AuthorDate: Sat Mar 26 15:14:33 2022 +0900 tests/testutils/repo/zip.py: Removing Zip test repo scaffold --- tests/conftest.py | 2 -- tests/testutils/repo/zip.py | 33 --------------------------------- 2 files changed, 35 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index f58f419..168a8ca 100755 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -34,7 +34,6 @@ from buildstream._testing.integration import integration_cache # pylint: disabl from tests.testutils.repo.git import Git from tests.testutils.repo.bzr import Bzr from tests.testutils.repo.tar import Tar -from tests.testutils.repo.zip import Zip # @@ -133,7 +132,6 @@ def remote_services(request): register_repo_kind("git", Git, None) register_repo_kind("bzr", Bzr, None) register_repo_kind("tar", Tar, None) -register_repo_kind("zip", Zip, None) # This hook enables pytest to collect the templated source tests from diff --git a/tests/testutils/repo/zip.py b/tests/testutils/repo/zip.py deleted file mode 100644 index d2f8d9b..0000000 --- a/tests/testutils/repo/zip.py +++ /dev/null @@ -1,33 +0,0 @@ -import os -import zipfile - -from buildstream.utils import sha256sum - -from buildstream._testing import Repo - - -class Zip(Repo): - def create(self, directory): - archive = os.path.join(self.repo, "file.zip") - - old_dir = os.getcwd() - os.chdir(directory) - with zipfile.ZipFile(archive, "w") as zipfp: - for root, dirs, files in os.walk("."): - names = dirs + files - names = [os.path.join(root, name) for name in names] - - for name in names: - zipfp.write(name) - - os.chdir(old_dir) - - return sha256sum(archive) - - def source_config(self, ref=None): - archive = os.path.join(self.repo, "file.zip") - config = {"kind": "zip", "url": "file://" + archive, "directory": "", "base-dir": ""} - if ref is not None: - config["ref"] = ref - - return config
