MCPcopy Index your code
hub / github.com/ipython/ipython / test_dollar_formatter

Function test_dollar_formatter

tests/test_text.py:99–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97
98
99def test_dollar_formatter():
100 f = text.DollarFormatter()
101 eval_formatter_check(f)
102 eval_formatter_slicing_check(f)
103
104 ns = dict(n=12, pi=math.pi, stuff="hello there", os=os)
105 s = f.format("$n", **ns)
106 assert s == "12"
107 s = f.format("$n.real", **ns)
108 assert s == "12"
109 s = f.format("$n/{stuff[:5]}", **ns)
110 assert s == "12/hello"
111 s = f.format("$n $$HOME", **ns)
112 assert s == "12 $HOME"
113 s = f.format("${foo}", foo="HOME")
114 assert s == "$HOME"
115
116
117def test_strip_email():

Callers

nothing calls this directly

Calls 3

eval_formatter_checkFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…