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:359–363  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

357 box_from_string("- 1\n- 2\n", string_type="yaml")
358
359 def test_box_from_string_json(self):
360 assert box_from_string('{"a": 1}').to_dict() == {"a": 1}
361 assert box_from_string("[1, 2]").to_list() == [1, 2]
362 with pytest.raises(BoxError, match="not JSON"):
363 box_from_string("{nope")
364
365 def test_box_from_string_toml(self):
366 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