MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_image

Method test_image

tests/chat/test_attachments.py:492–503  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

process_browser_fileFunction · 0.90

Tested by

no test coverage detected