(self)
| 490 | """Tests for process_browser_file (browser-uploaded files).""" |
| 491 | |
| 492 | def test_image(self): |
| 493 | import base64 |
| 494 | |
| 495 | raw = b"\x89PNG\r\n\x1a\n" + b"\x00" * 100 |
| 496 | b64 = base64.b64encode(raw).decode() |
| 497 | att = process_browser_file("photo.png", b64, "image/png") |
| 498 | assert att.source == "browser:photo.png" |
| 499 | assert att.display_name == "photo.png" |
| 500 | assert att.mime_type == "image/png" |
| 501 | assert att.size_bytes == len(raw) |
| 502 | assert len(att.content_blocks) == 1 |
| 503 | assert att.content_blocks[0]["type"] == "image_url" |
| 504 | |
| 505 | def test_text(self): |
| 506 | import base64 |
nothing calls this directly
no test coverage detected