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

Method test_box_from_string_json

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

Source from the content-addressed store, hash-verified

343 box_from_string("a: 1", string_type="toon")
344
345 def test_box_from_string_json(self):
346 assert box_from_string('{"a": 1}').to_dict() == {"a": 1}
347 assert box_from_string("[1, 2]").to_list() == [1, 2]
348 with pytest.raises(BoxError, match="not JSON"):
349 box_from_string("{nope")
350
351 def test_box_from_string_toml(self):
352 assert box_from_string("a = 1", string_type="toml").to_dict() == {"a": 1}

Callers

nothing calls this directly

Calls 3

box_from_stringFunction · 0.90
to_dictMethod · 0.80
to_listMethod · 0.80

Tested by

no test coverage detected