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

Method test_latex_completions

tests/test_completer.py:317–332  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

315 self.assertIsInstance(matches, list)
316
317 def test_latex_completions(self):
318 ip = get_ipython()
319 # Test some random unicode symbols
320 keys = random.sample(sorted(latex_symbols), 10)
321 for k in keys:
322 text, matches = ip.complete(k)
323 self.assertEqual(text, k)
324 self.assertEqual(matches, [latex_symbols[k]])
325 # Test a more complex line
326 text, matches = ip.complete("print(\\alpha")
327 self.assertEqual(text, "\\alpha")
328 self.assertEqual(matches[0], latex_symbols["\\alpha"])
329 # Test multiple matching latex symbols
330 text, matches = ip.complete("\\al")
331 self.assertIn("\\alpha", matches)
332 self.assertIn("\\aleph", matches)
333
334 def test_latex_no_results(self):
335 """

Callers

nothing calls this directly

Calls 2

get_ipythonFunction · 0.90
completeMethod · 0.45

Tested by

no test coverage detected