Skip to content

Commit

Permalink
Add installed repo test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnair1 committed Aug 9, 2022
1 parent d6db1a9 commit 59dcd4e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Metadata-Version: 2.1
Name: git-pep-610-subdirectory
Version: 1.2.3
Summary: Foo
License: MIT
Requires-Python: >=3.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"url": "https://github.com/demo/git-pep-610-subdirectory.git",
"vcs_info": {
"vcs": "git",
"requested_revision": "my-branch",
"commit_id": "123456"
},
"subdirectory": "subdir"
}
17 changes: 17 additions & 0 deletions tests/repositories/test_installed_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
metadata.PathDistribution(
SITE_PURELIB / "git_pep_610_no_requested_version-1.2.3.dist-info"
),
metadata.PathDistribution(
SITE_PURELIB / "git_pep_610_subdirectory-1.2.3.dist-info"
),
metadata.PathDistribution(SITE_PURELIB / "url_pep_610-1.2.3.dist-info"),
metadata.PathDistribution(SITE_PURELIB / "file_pep_610-1.2.3.dist-info"),
metadata.PathDistribution(SITE_PURELIB / "directory_pep_610-1.2.3.dist-info"),
Expand Down Expand Up @@ -238,6 +241,20 @@ def test_load_pep_610_compliant_git_packages_no_requested_version(
assert package.source_reference == package.source_resolved_reference


def test_load_pep_610_compliant_git_packages_with_subdirectory(
repository: InstalledRepository,
):
package = get_package_from_repository("git-pep-610-subdirectory", repository)
assert package is not None
assert package.name == "git-pep-610-subdirectory"
assert package.version.text == "1.2.3"
assert package.source_type == "git"
assert package.source_url == "https://github.com/demo/git-pep-610-subdirectory.git"
assert package.source_reference == "my-branch"
assert package.source_resolved_reference == "123456"
assert package.source_subdirectory == "subdir"


def test_load_pep_610_compliant_url_packages(repository: InstalledRepository):
package = get_package_from_repository("url-pep-610", repository)

Expand Down

0 comments on commit 59dcd4e

Please sign in to comment.