| 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"): |