MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_view_image

Function test_view_image

test/mitmproxy/contentviews/_view_image/test_view.py:5–16  ·  view source on GitHub ↗
(tdata)

Source from the content-addressed store, hash-verified

3
4
5def test_view_image(tdata):
6 for img in [
7 "mitmproxy/data/image.png",
8 "mitmproxy/data/image.gif",
9 "mitmproxy/data/all.jpeg",
10 "mitmproxy/data/image.ico",
11 ]:
12 with open(tdata.path(img), "rb") as f:
13 desc = image.prettify(f.read(), Metadata())
14 assert img.split(".")[-1].upper() in desc
15
16 assert image.prettify(b"flibble", Metadata()) == ("# Unknown Image\n")
17
18
19def test_render_priority():

Callers

nothing calls this directly

Calls 5

MetadataClass · 0.90
pathMethod · 0.45
prettifyMethod · 0.45
readMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…