diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 6ad1ff28..951f2085 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -110,3 +110,20 @@ def test_normalize_doi(): assert utils.normalize_doi("http://doi.org/10.1234/jshd123") == "10.1234/jshd123" assert utils.normalize_doi("https://doi.org/10.1234/jshd123") == "10.1234/jshd123" assert utils.normalize_doi("http://dx.doi.org/10.1234/jshd123") == "10.1234/jshd123" + + +@pytest.mark.parametrize( + "req, is_local", + [ + ("-r requirements.txt", True), + ("-e .", True), + ("file://subdir", True), + ("file://./subdir", True), + ("git://github.com/jupyter/repo2docker", False), + ("git+https://github.com/jupyter/repo2docker", False), + ("numpy", False), + ("# -e .", False), + ], +) +def test_local_pip_requirement(req, is_local): + assert utils.is_local_pip_requirement(req) == is_local