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

Method test_match_dict_keys

IPython/core/tests/test_completer.py:763–781  ·  view source on GitHub ↗

Test that match_dict_keys works on a couple of use case does return what expected, and does not crash

(self)

Source from the content-addressed store, hash-verified

761 nt.assert_list_equal(["NoColor"], matches)
762
763 def test_match_dict_keys(self):
764 """
765 Test that match_dict_keys works on a couple of use case does return what
766 expected, and does not crash
767 """
768 delims = " \t\n`!@#$^&*()=+[{]}\\|;:'\",<>?"
769
770 keys = ["foo", b"far"]
771 assert match_dict_keys(keys, "b'", delims=delims) == ("'", 2, ["far"])
772 assert match_dict_keys(keys, "b'f", delims=delims) == ("'", 2, ["far"])
773 assert match_dict_keys(keys, 'b"', delims=delims) == ('"', 2, ["far"])
774 assert match_dict_keys(keys, 'b"f', delims=delims) == ('"', 2, ["far"])
775
776 assert match_dict_keys(keys, "'", delims=delims) == ("'", 1, ["foo"])
777 assert match_dict_keys(keys, "'f", delims=delims) == ("'", 1, ["foo"])
778 assert match_dict_keys(keys, '"', delims=delims) == ('"', 1, ["foo"])
779 assert match_dict_keys(keys, '"f', delims=delims) == ('"', 1, ["foo"])
780
781 match_dict_keys
782
783 def test_dict_key_completion_string(self):
784 """Test dictionary key completion for string keys"""

Callers

nothing calls this directly

Calls 1

match_dict_keysFunction · 0.90

Tested by

no test coverage detected