| 178 | self.assertEqual(first.chunk_set.id, second.chunk_set.id) |
| 179 | self.assertEqual(first.global_summary.id, second.global_summary.id) |
| 180 | self.assertEqual( |
| 181 | [chunk.chunk_id for chunk in first.chunk_set.chunks], |
| 182 | [chunk.chunk_id for chunk in second.chunk_set.chunks], |
| 183 | ) |
| 184 | |
| 185 | |
| 186 | class SourceDispatchTests(unittest.IsolatedAsyncioTestCase): |
| 187 | async def test_http_pdf_preserves_resolved_url_and_fetch_time(self) -> None: |
| 188 | raw = Fetched( |
| 189 | bytes=b"%PDF", |
| 190 | content_type="application/pdf", |
| 191 | source_url="https://example.test/input.pdf", |
| 192 | resolved_url="https://cdn.example.test/exact.pdf", |
| 193 | fetched_at=_WHEN, |
| 194 | ) |
| 195 | with patch( |
| 196 | "quantmind.flows.paper.fetch_url", |
| 197 | new=AsyncMock(return_value=raw), |
| 198 | ): |
| 199 | fetched = await _fetch_paper_source( |
| 200 | HttpUrl(url="https://example.test/input.pdf") |
| 201 | ) |
| 202 | |
| 203 | self.assertEqual(fetched.uri, "https://cdn.example.test/exact.pdf") |
nothing calls this directly
no outgoing calls
no test coverage detected