Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
wronaq committed Apr 5, 2024
1 parent 2a42cc8 commit 3f75010
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/data/test_requirements_hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# This file is autogenerated by poetry with Python 3.11
# by the following command:
#
# poetry export -f requirements.txt --output requirements/tmp.txt
#

packaging==24.0 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5 \
--hash=sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9
toskip==0.0.1 ; python_version >= "3.8" and python_version < "3.10" \
--hash=sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5
15 changes: 15 additions & 0 deletions tests/test_get_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,18 @@ def test_doGetReqs_requirements() -> None:
"XARRAY" not in deps
) # xarray is an optional dependency of pandas associated with 'computation' key that is not
# tracked in test_requirements.txt

def test_doGetReqs_requirements_with_hashes() -> None:
using = "requirements"
extras = []
pyproject = {}
requirementsPaths = [Path(f"{THISDIR}/data/test_requirements_hash.txt")]
skipDependencies = [types.ucstr("TOSKIP")]

deps = get_deps.do_get_reqs(using, skipDependencies, extras, pyproject, requirementsPaths)
assert deps == {
"PACKAGING"
}
assert (
"TOSKIP" not in deps
)

0 comments on commit 3f75010

Please sign in to comment.