()
| 149 | # --------------------------------------------------------------------------- |
| 150 | |
| 151 | def test_safe_fetch_text_decodes_utf8(): |
| 152 | content = "héllo wörld".encode("utf-8") |
| 153 | mock_resp = _make_mock_response(content) |
| 154 | with patch("graphify.security._build_opener") as mock_opener_fn: |
| 155 | mock_opener = MagicMock() |
| 156 | mock_opener.open.return_value = mock_resp |
| 157 | mock_opener_fn.return_value = mock_opener |
| 158 | result = safe_fetch_text("https://example.com/") |
| 159 | assert result == "héllo wörld" |
| 160 | |
| 161 | def test_safe_fetch_text_replaces_bad_bytes(): |
| 162 | bad = b"hello \xff world" |
nothing calls this directly
no test coverage detected