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

Method test_box_from_string_toon

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

Source from the content-addressed store, hash-verified

360 box_from_string("a: [1", string_type="yaml")
361
362 def test_box_from_string_toon(self):
363 if not from_file.toon_available:
364 pytest.skip("toon_format is not installed")
365 assert box_from_string(Box(a=1).to_toon(), string_type="toon").to_dict() == {"a": 1}
366 rows = BoxList([{"a": 1}, {"a": 2}]).to_toon()
367 assert box_from_string(rows, string_type="toon").to_list() == [{"a": 1}, {"a": 2}]
368 with pytest.raises(BoxError, match="not TOON"):
369 box_from_string('a: "unterminated', string_type="toon")
370
371 def test_box_from_string_unknown_type(self):
372 with pytest.raises(BoxError, match="Unsupported"):

Callers

nothing calls this directly

Calls 6

box_from_stringFunction · 0.90
BoxClass · 0.90
BoxListClass · 0.90
to_dictMethod · 0.80
to_listMethod · 0.80
to_toonMethod · 0.45

Tested by

no test coverage detected