(
client: TestClient,
filenames_gzipped: List[str],
filenames_verbatim: List[str],
content_type: str,
options: dict,
samples_dir: str = "sample-docs",
)
| 110 | |
| 111 | |
| 112 | def call_api( |
| 113 | client: TestClient, |
| 114 | filenames_gzipped: List[str], |
| 115 | filenames_verbatim: List[str], |
| 116 | content_type: str, |
| 117 | options: dict, |
| 118 | samples_dir: str = "sample-docs", |
| 119 | ) -> httpx.Response: |
| 120 | files = [] |
| 121 | for filename in filenames_gzipped: |
| 122 | full_path = Path(samples_dir) / filename |
| 123 | files.append(("files", (str(full_path), open(full_path, "rb"), "application/gzip"))) |
| 124 | |
| 125 | for filename in filenames_verbatim: |
| 126 | full_path = Path(samples_dir) / filename |
| 127 | files.append(("files", (str(full_path), open(full_path, "rb"), content_type))) |
| 128 | |
| 129 | response = client.post( |
| 130 | MAIN_API_ROUTE, |
| 131 | files=files, |
| 132 | data=options, |
| 133 | ) |
| 134 | assert response.status_code == 200, response.text |
| 135 | assert len(response.text) > 0 |
| 136 | return response |
| 137 | |
| 138 | |
| 139 | def get_gzipped_response( |
no outgoing calls
no test coverage detected