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

Method test_image_file

tests/chat/test_attachments.py:198–208  ·  view source on GitHub ↗
(self, tmp_path)

Source from the content-addressed store, hash-verified

196
197class TestProcessLocalFile:
198 def test_image_file(self, tmp_path):
199 img = tmp_path / "test.png"
200 img.write_bytes(b"\x89PNG\r\n\x1a\n" + b"\x00" * 100)
201 att = process_local_file(str(img))
202 assert att.mime_type == "image/png"
203 assert att.display_name == "test.png"
204 assert att.size_bytes > 0
205 assert len(att.content_blocks) == 1
206 block = att.content_blocks[0]
207 assert block["type"] == "image_url"
208 assert block["image_url"]["url"].startswith("data:image/png;base64,")
209
210 def test_text_file(self, tmp_path):
211 txt = tmp_path / "code.py"

Callers

nothing calls this directly

Calls 1

process_local_fileFunction · 0.90

Tested by

no test coverage detected