MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_styling

Function test_styling

test/mitmproxy/addons/test_termlog.py:36–46  ·  view source on GitHub ↗
(monkeypatch)

Source from the content-addressed store, hash-verified

34
35
36async def test_styling(monkeypatch) -> None:
37 monkeypatch.setattr(vt_codes, "ensure_supported", lambda _: True)
38
39 f = io.StringIO()
40 t = termlog.TermLog(out=f)
41 with taddons.context(t) as tctx:
42 tctx.configure(t)
43 logging.warning("hello")
44
45 assert "\x1b[33mhello\x1b[0m" in f.getvalue()
46 t.uninstall()
47
48
49async def test_cannot_print(monkeypatch) -> None:

Callers

nothing calls this directly

Calls 4

uninstallMethod · 0.95
contextMethod · 0.80
getvalueMethod · 0.80
configureMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…