INNER CODE UNIT · Python
test_package_missing_pip
logandk/serverless-wsgi · requirements_test.py:185
def test_package_missing_pip(mock_system, mock_virtualenv, monkeypatch):
monkeypatch.setattr(os.path, "isfile", lambda f: f != "/tmp/.venv/bin/pip")
with pytest.raises(SystemExit):
requirements.package(["/path1/requirements.txt"], "/tmp")
def test_package_missing_python_dir(mock_system, mock_virtualenv, monkeypatch):
monkeypatch.setattr(os, "listdir", lambda f: [])
with pytest.raises(SystemExit):
requirements.package(["/path1/requirements.txt"], "/tmp")
def test_package_windows(mock_system, mock_virtualenv, monkeypatch):
monkeypatch.setattr(platform, "system", lambda: "Windows")
requirements.package(["/path1/requirements.txt"], "/tmp")