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

Method test_func_kw_completions

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

Source from the content-addressed store, hash-verified

832 self.assertIn("Test", matches)
833
834 def test_func_kw_completions(self):
835 ip = get_ipython()
836 c = ip.Completer
837 c.use_jedi = False
838 ip.ex("def myfunc(a=1,b=2): return a+b")
839 s, matches = c.complete(None, "myfunc(1,b")
840 self.assertIn("b=", matches)
841 # Simulate completing with cursor right after b (pos==10):
842 s, matches = c.complete(None, "myfunc(1,b)", 10)
843 self.assertIn("b=", matches)
844 s, matches = c.complete(None, 'myfunc(a="escaped\\")string",b')
845 self.assertIn("b=", matches)
846 # builtin function
847 s, matches = c.complete(None, "min(k, k")
848 self.assertIn("key=", matches)
849
850 def test_default_arguments_from_docstring(self):
851 ip = get_ipython()

Callers

nothing calls this directly

Calls 3

get_ipythonFunction · 0.90
exMethod · 0.80
completeMethod · 0.45

Tested by

no test coverage detected