forked from pypa/pipenv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test case for requirements with git req
- Loading branch information
Fraser Langton
committed
Apr 25, 2022
1 parent
b535cd4
commit d35ab4c
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import json | ||
|
||
import pytest | ||
|
||
|
||
|
@@ -66,3 +68,28 @@ def test_requirements_generates_requirements_from_lockfile_multiple_sources(Pipe | |
|
||
assert '-i https://pypi.org/simple' in c.stdout | ||
assert '--extra-index-url https://some_other_source.org' in c.stdout | ||
|
||
|
||
@pytest.mark.requirements | ||
def test_requirements_with_git_requirements(PipenvInstance): | ||
req_name, req_hash = 'example-repo', 'cc858e89f19bc0dbd70983f86b811ab625dc9292' | ||
lockfile = { | ||
"_meta": {"sources": []}, | ||
"default": { | ||
req_name: { | ||
"editable": True, | ||
"git": F"ssh://[email protected]/code/{req_name}.git", | ||
"ref": req_hash | ||
} | ||
}, | ||
"develop": {} | ||
} | ||
|
||
with PipenvInstance(chdir=True) as p: | ||
with open(p.lockfile_path, 'w') as f: | ||
json.dump(lockfile, f) | ||
|
||
c = p.pipenv('requirements') | ||
assert c.returncode == 0 | ||
assert req_name in c.stdout | ||
assert req_hash in c.stdout |