From 009d09815a9b94d22896ebb31be3986528353962 Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 18 Jul 2019 14:40:17 +0200 Subject: [PATCH] test local pip requirements --- tests/unit/test_utils.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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