| from app import render_iarc_block | |
| def test_iarc_render_url(): | |
| md = render_iarc_block({"ok": True, "url": "https://example.com"}) | |
| assert "Search IARC Monographs" in md | |
| assert "https://example.com" in md | |
| def test_iarc_render_results_list(): | |
| md = render_iarc_block( | |
| { | |
| "ok": True, | |
| "results": [ | |
| {"title": "IARC Monographs - Foo", "url": "https://example.com/foo", "year": "2020"} | |
| ], | |
| } | |
| ) | |
| assert "- [IARC Monographs - Foo](https://example.com/foo) (2020)" in md | |