This is an automated email from the ASF dual-hosted git repository. tvb pushed a commit to branch tristan/remove-plugins in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit f9bab3d23a655f9859f465dc5b5c0fda876a80cd Author: Tristan van Berkom <[email protected]> AuthorDate: Mon Mar 28 16:32:11 2022 +0900 tests/sources/pip.py: Removing pip source test --- tests/sources/pip.py | 61 --------------------------- tests/sources/pip/first-source-pip/target.bst | 6 --- tests/sources/pip/no-packages/file | 1 - tests/sources/pip/no-packages/target.bst | 6 --- tests/sources/pip/no-ref/file | 1 - tests/sources/pip/no-ref/target.bst | 8 ---- 6 files changed, 83 deletions(-) diff --git a/tests/sources/pip.py b/tests/sources/pip.py deleted file mode 100644 index 08483e4..0000000 --- a/tests/sources/pip.py +++ /dev/null @@ -1,61 +0,0 @@ -# Pylint doesn't play well with fixtures and dependency injection from pytest -# pylint: disable=redefined-outer-name - -import os -import pytest - -from buildstream.exceptions import ErrorDomain -from buildstream.plugins.sources.pip import _match_package_name -from buildstream._testing import cli, generate_project # pylint: disable=unused-import - -DATA_DIR = os.path.join( - os.path.dirname(os.path.realpath(__file__)), - "pip", -) - - -# Test that without ref, consistency is set appropriately. [email protected](os.path.join(DATA_DIR, "no-ref")) -def test_no_ref(cli, datafiles): - project = str(datafiles) - generate_project(project) - assert cli.get_element_state(project, "target.bst") == "no reference" - - -# Test that pip is not allowed to be the first source [email protected](os.path.join(DATA_DIR, "first-source-pip")) -def test_first_source(cli, datafiles): - project = str(datafiles) - generate_project(project) - result = cli.run(project=project, args=["show", "target.bst"]) - result.assert_main_error(ErrorDomain.ELEMENT, None) - - -# Test that error is raised when neither packges nor requirements files -# have been specified [email protected](os.path.join(DATA_DIR, "no-packages")) -def test_no_packages(cli, datafiles): - project = str(datafiles) - generate_project(project) - result = cli.run(project=project, args=["show", "target.bst"]) - result.assert_main_error(ErrorDomain.SOURCE, None) - - -# Test that pip source parses tar ball names correctly for the ref [email protected]( - "tarball, expected_name, expected_version", - [ - ("dotted.package-0.9.8.tar.gz", "dotted.package", "0.9.8"), - ("hyphenated-package-2.6.0.tar.gz", "hyphenated-package", "2.6.0"), - ("underscore_pkg-3.1.0.tar.gz", "underscore_pkg", "3.1.0"), - ("numbers2and5-1.0.1.tar.gz", "numbers2and5", "1.0.1"), - ("multiple.dots.package-5.6.7.tar.gz", "multiple.dots.package", "5.6.7"), - ("multiple-hyphens-package-1.2.3.tar.gz", "multiple-hyphens-package", "1.2.3"), - ("multiple_underscore_pkg-3.4.5.tar.gz", "multiple_underscore_pkg", "3.4.5"), - ("shortversion-1.0.tar.gz", "shortversion", "1.0"), - ("longversion-1.2.3.4.tar.gz", "longversion", "1.2.3.4"), - ], -) -def test_match_package_name(tarball, expected_name, expected_version): - name, version = _match_package_name(tarball) - assert (expected_name, expected_version) == (name, version) diff --git a/tests/sources/pip/first-source-pip/target.bst b/tests/sources/pip/first-source-pip/target.bst deleted file mode 100644 index e5f20ab..0000000 --- a/tests/sources/pip/first-source-pip/target.bst +++ /dev/null @@ -1,6 +0,0 @@ -kind: import -description: pip should not be allowed to be the first source -sources: -- kind: pip - packages: - - flake8 diff --git a/tests/sources/pip/no-packages/file b/tests/sources/pip/no-packages/file deleted file mode 100644 index 980a0d5..0000000 --- a/tests/sources/pip/no-packages/file +++ /dev/null @@ -1 +0,0 @@ -Hello World! diff --git a/tests/sources/pip/no-packages/target.bst b/tests/sources/pip/no-packages/target.bst deleted file mode 100644 index 0d8b948..0000000 --- a/tests/sources/pip/no-packages/target.bst +++ /dev/null @@ -1,6 +0,0 @@ -kind: import -description: The kind of this element is irrelevant. -sources: -- kind: local - path: file -- kind: pip diff --git a/tests/sources/pip/no-ref/file b/tests/sources/pip/no-ref/file deleted file mode 100644 index 980a0d5..0000000 --- a/tests/sources/pip/no-ref/file +++ /dev/null @@ -1 +0,0 @@ -Hello World! diff --git a/tests/sources/pip/no-ref/target.bst b/tests/sources/pip/no-ref/target.bst deleted file mode 100644 index ec450b7..0000000 --- a/tests/sources/pip/no-ref/target.bst +++ /dev/null @@ -1,8 +0,0 @@ -kind: import -description: The kind of this element is irrelevant. -sources: -- kind: local - path: file -- kind: pip - packages: - - flake8
