(self)
| 303 | class TestIdentifierURLMetadata: |
| 304 | |
| 305 | def test_html_page(self): |
| 306 | ident = IdentifierModule() |
| 307 | html = """ |
| 308 | <html> |
| 309 | <head><title>My Very Long Paper Title - PDF Download</title></head> |
| 310 | <body> |
| 311 | <div class="authors">By Alice Smith, Bob Jones</div> |
| 312 | <p>Published 2021.</p> |
| 313 | </body> |
| 314 | </html> |
| 315 | """ |
| 316 | with patch("onecite.pipeline.requests.get", |
| 317 | return_value=DummyResponse(content=html.encode(), |
| 318 | headers={"content-type": "text/html"})): |
| 319 | meta = ident._extract_metadata_from_url("https://example.com/page") |
| 320 | |
| 321 | assert meta["title"] == "My Very Long Paper Title" |
| 322 | assert meta["year"] == 2021 |
| 323 | assert "Alice Smith" in meta["author"] |
| 324 | |
| 325 | def test_pdf_delegates_to_extractor(self): |
| 326 | ident = IdentifierModule() |
nothing calls this directly
no test coverage detected