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

Source from the content-addressed store, hash-verified

374 box_from_string("a: [1", string_type="yaml")
375
376 def test_box_from_string_toon(self):
377 if not from_file.toon_available:
378 pytest.skip("toon_format is not installed")
379 assert box_from_string(Box(a=1).to_toon(), string_type="toon").to_dict() == {"a": 1}
380 rows = BoxList([{"a": 1}, {"a": 2}]).to_toon()
381 assert box_from_string(rows, string_type="toon").to_list() == [{"a": 1}, {"a": 2}]
382 with pytest.raises(BoxError, match="not TOON"):
383 box_from_string('a: "unterminated', string_type="toon")
384
385 def test_box_from_string_unknown_type(self):
386 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