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

Method test_dict_key_completion_unicode_py3

tests/test_completer.py:1657–1681  ·  view source on GitHub ↗

Test handling of unicode in dict key completion

(self)

Source from the content-addressed store, hash-verified

1655 self.assertNotIn("abd", matches)
1656
1657 def test_dict_key_completion_unicode_py3(self):
1658 """Test handling of unicode in dict key completion"""
1659 ip = get_ipython()
1660 complete = ip.Completer.complete
1661
1662 ip.user_ns["d"] = {"a\u05d0": None}
1663
1664 # query using escape
1665 if sys.platform != "win32":
1666 # Known failure on Windows
1667 _, matches = complete(line_buffer="d['a\\u05d0")
1668 self.assertIn("u05d0", matches) # tokenized after \\
1669
1670 # query using character
1671 _, matches = complete(line_buffer="d['a\u05d0")
1672 self.assertIn("a\u05d0", matches)
1673
1674 with greedy_completion():
1675 # query using escape
1676 _, matches = complete(line_buffer="d['a\\u05d0")
1677 self.assertIn("d['a\\u05d0']", matches) # tokenized after \\
1678
1679 # query using character
1680 _, matches = complete(line_buffer="d['a\u05d0")
1681 self.assertIn("d['a\u05d0']", matches)
1682
1683 @dec.skip_without("numpy")
1684 def test_struct_array_key_completion(self):

Callers

nothing calls this directly

Calls 2

get_ipythonFunction · 0.90
greedy_completionFunction · 0.85

Tested by

no test coverage detected