MCPcopy Create free account
hub / github.com/ipython/ipython / test_completes_in_dict_expressions

Method test_completes_in_dict_expressions

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

Source from the content-addressed store, hash-verified

816 self.assertIn(".method_one", matches)
817
818 def test_completes_in_dict_expressions(self):
819 ip = get_ipython()
820 c = ip.Completer
821 c.use_jedi = False
822 ip.ex("class Test: pass")
823 ip.ex("test_obj = Test()")
824 ip.ex("test_obj.attribute = 'value'")
825
826 # Test completion in dictionary expressions
827 s, matches = c.complete(None, "d = {'key': test_obj.attr")
828 self.assertIn(".attribute", matches)
829
830 # Test global completion in dictionary expressions with dots
831 s, matches = c.complete(None, "d = {'k.e.y': Te")
832 self.assertIn("Test", matches)
833
834 def test_func_kw_completions(self):
835 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