()
| 148 | eval_formatter_slicing_check(f) |
| 149 | |
| 150 | def test_dollar_formatter(): |
| 151 | f = text.DollarFormatter() |
| 152 | eval_formatter_check(f) |
| 153 | eval_formatter_slicing_check(f) |
| 154 | |
| 155 | ns = dict(n=12, pi=math.pi, stuff='hello there', os=os) |
| 156 | s = f.format("$n", **ns) |
| 157 | nt.assert_equal(s, "12") |
| 158 | s = f.format("$n.real", **ns) |
| 159 | nt.assert_equal(s, "12") |
| 160 | s = f.format("$n/{stuff[:5]}", **ns) |
| 161 | nt.assert_equal(s, "12/hello") |
| 162 | s = f.format("$n $$HOME", **ns) |
| 163 | nt.assert_equal(s, "12 $HOME") |
| 164 | s = f.format("${foo}", foo="HOME") |
| 165 | nt.assert_equal(s, "$HOME") |
| 166 | |
| 167 | |
| 168 | def test_long_substr(): |
nothing calls this directly
no test coverage detected