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

Function test_box_round_trip

test/test_audit_sync.py:593–608  ·  view source on GitHub ↗
(cls, options, round_trip)

Source from the content-addressed store, hash-verified

591@pytest.mark.parametrize("options", BOX_OPTIONS)
592@pytest.mark.parametrize("round_trip", ROUND_TRIPS)
593def test_box_round_trip(cls, options, round_trip):
594 b = _annotated_box(cls, options)
595 out = round_trip(b)
596 assert out is not b
597 assert _box_state(out) == _box_state(b)
598 if options.get("frozen_box"):
599 with pytest.raises(BoxError):
600 out.Top = 5
601 with pytest.raises(BoxError):
602 out.sub.k = 5
603 else:
604 out.set_comment("Top", "changed")
605 assert b.get_comment("Top") == {"before": "top-c"}
606 if options.get("box_dots"):
607 assert out["lst[0].i"] == 0
608 assert out.get_comment("lst[1]") == {"eol": "l1-c"}
609
610
611@pytest.mark.parametrize("round_trip", ROUND_TRIPS[:2] + ROUND_TRIPS[3:])

Callers

nothing calls this directly

Calls 5

_annotated_boxFunction · 0.85
_box_stateFunction · 0.85
getMethod · 0.80
set_commentMethod · 0.45
get_commentMethod · 0.45

Tested by

no test coverage detected