Skip to content

Commit

Permalink
test case for requirements with git req
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraser Langton committed Apr 25, 2022
1 parent b535cd4 commit d35ab4c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/integration/test_requirements.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json

import pytest


Expand Down Expand Up @@ -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

0 comments on commit d35ab4c

Please sign in to comment.