(self)
| 204 | nt.assert_true(isinstance(matches, list)) |
| 205 | |
| 206 | def test_latex_completions(self): |
| 207 | from IPython.core.latex_symbols import latex_symbols |
| 208 | import random |
| 209 | |
| 210 | ip = get_ipython() |
| 211 | # Test some random unicode symbols |
| 212 | keys = random.sample(latex_symbols.keys(), 10) |
| 213 | for k in keys: |
| 214 | text, matches = ip.complete(k) |
| 215 | nt.assert_equal(len(matches), 1) |
| 216 | nt.assert_equal(text, k) |
| 217 | nt.assert_equal(matches[0], latex_symbols[k]) |
| 218 | # Test a more complex line |
| 219 | text, matches = ip.complete("print(\\alpha") |
| 220 | nt.assert_equal(text, "\\alpha") |
| 221 | nt.assert_equal(matches[0], latex_symbols["\\alpha"]) |
| 222 | # Test multiple matching latex symbols |
| 223 | text, matches = ip.complete("\\al") |
| 224 | nt.assert_in("\\alpha", matches) |
| 225 | nt.assert_in("\\aleph", matches) |
| 226 | |
| 227 | def test_latex_no_results(self): |
| 228 | """ |
nothing calls this directly
no test coverage detected