MCPcopy Create free account
hub / github.com/cdgriffith/Box / test_missing_keys

Method test_missing_keys

test/test_comments.py:162–170  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

160 Box(a=1).set_comment(*args)
161
162 def test_missing_keys(self):
163 with pytest.raises(BoxKeyError, match="existing keys"):
164 Box().set_comment("missing", "x")
165 with pytest.raises(BoxKeyError):
166 Box().get_comment("missing")
167 with pytest.raises(BoxKeyError, match="existing items"):
168 BoxList([1]).set_comment(3, "x")
169 with pytest.raises(BoxKeyError):
170 Box(a={"b": 1}).set_comment("a.b", "x") # dotted paths need box_dots
171
172 def test_box_dots_paths(self):
173 bx = Box({"a": {"b": 1}, "l": [{"x": 1}, 2]}, box_dots=True)

Callers

nothing calls this directly

Calls 4

BoxClass · 0.90
BoxListClass · 0.90
set_commentMethod · 0.45
get_commentMethod · 0.45

Tested by

no test coverage detected