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

Method test_blob_fallback

tests/apps/test_host.py:460–465  ·  view source on GitHub ↗

If no text but blob is present, base64-decode the blob.

(self)

Source from the content-addressed store, hash-verified

458 assert AppHostServer._extract_html(resource) == "<html>nested</html>"
459
460 def test_blob_fallback(self):
461 """If no text but blob is present, base64-decode the blob."""
462 html = "<html>blob content</html>"
463 b64 = base64.b64encode(html.encode()).decode()
464 resource = {"contents": [{"blob": b64}]}
465 assert AppHostServer._extract_html(resource) == html
466
467 def test_non_dict_first_item_returns_empty(self):
468 """Non-dict items in contents list produce empty string."""

Callers

nothing calls this directly

Calls 1

_extract_htmlMethod · 0.80

Tested by

no test coverage detected