Download tests/unit/shared/conftest.py from paisaly/backend: direct link, hf CLI and curl.
- Browser
- Download file 335 Bytes
-
https://huggingface.co/spaces/paisaly/backend/resolve/main/tests/unit/shared/conftest.py
- Command line
-
hf download hf://spaces/paisaly/backend/tests/unit/shared/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/paisaly/backend/resolve/main/tests/unit/shared/conftest.py
335 Bytes
| from __future__ import annotations | |
| from unittest.mock import MagicMock | |
| def _make_request(headers: dict, client_host: str = "10.0.0.1") -> MagicMock: | |
| """Minimal mock of a FastAPI Request.""" | |
| req = MagicMock() | |
| req.headers = headers | |
| req.client = MagicMock() | |
| req.client.host = client_host | |
| return req | |