-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support + test source_url/download_url combinations (#435)
- Loading branch information
1 parent
960de96
commit f4af971
Showing
3 changed files
with
55 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import pytest | ||
|
||
from webviz_config._dockerize._create_docker_setup import get_python_requirements | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"distributions, requirements", | ||
[ | ||
( | ||
{ | ||
"webviz-config": { | ||
"download_url": "https://pypi.org/project/webviz-config", | ||
"source_url": None, | ||
"dist_version": "0.3.0", | ||
} | ||
}, | ||
["webviz-config==0.3.0"], | ||
), | ||
( | ||
{ | ||
"webviz-config": { | ||
"download_url": None, | ||
"source_url": None, | ||
"dist_version": "0.3.0", | ||
} | ||
}, | ||
[], | ||
), | ||
( | ||
{ | ||
"webviz-config": { | ||
"download_url": None, | ||
"source_url": "https://github.com/equinor/webviz-config", | ||
"dist_version": "0.3.0", | ||
} | ||
}, | ||
["git+https://github.com/equinor/[email protected]"], | ||
), | ||
], | ||
) | ||
def test_derived_requirements(distributions, requirements): | ||
with pytest.warns(None) as record: | ||
assert requirements == get_python_requirements(distributions) | ||
assert len(record) == len( | ||
[ | ||
metadata | ||
for metadata in distributions.values() | ||
if metadata["download_url"] is None and metadata["source_url"] is None | ||
] | ||
) |
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