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

Method test_missing_keys_and_paths

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

Source from the content-addressed store, hash-verified

335
336class TestEdgeCases:
337 def test_missing_keys_and_paths(self):
338 with pytest.raises(BoxKeyError):
339 Box(camel_killer_box=True).set_comment("missingKey", "x")
340 dotted = Box({"a": 1, "l": [1]}, box_dots=True)
341 for key in ("nope.x", "a.x", "l[0].x", "l[5]", "l[x]", "l.x"):
342 with pytest.raises(BoxKeyError):
343 dotted.set_comment(key, "x")
344 with pytest.raises(BoxKeyError):
345 BoxList([1]).set_comment(1.5, "x")
346
347 def test_delete_without_comments(self):
348 bx = Box(a=1)

Callers

nothing calls this directly

Calls 3

set_commentMethod · 0.95
BoxClass · 0.90
BoxListClass · 0.90

Tested by

no test coverage detected