INNER CODE UNIT · Python

test_package_existing_target_file

logandk/serverless-wsgi · requirements_test.py:169

def test_package_existing_target_file(mock_system, mock_virtualenv, monkeypatch):
    monkeypatch.setattr(os.path, "isdir", lambda f: False)

    with pytest.raises(SystemExit):
        requirements.package(["/path1/requirements.txt"], "/tmp")


def test_package_missing_deps(mock_system, mock_virtualenv, monkeypatch):
    monkeypatch.setattr(
        os.path, "isdir", lambda f: f != "/tmp/.venv/lib/dir1/site-packages"
    )

    with pytest.raises(SystemExit):
        requirements.package(["/path1/requirements.txt"], "/tmp")


def test_package_missing_pip(mock_system, mock_virtualenv, monkeypatch):
    monkeypatch.setattr(os.path, "isfile", lambda f: f != "/tmp/.venv/bin/pip")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…