def check_json_round_trip(spec): json_text = spec.to_json() spec_from_json = Spec.from_json(json_text) assert spec.eq_dag(spec_from_json)
def check_yaml_round_trip(spec): yaml_text = spec.to_yaml() spec_from_yaml = Spec.from_yaml(yaml_text) assert spec.eq_dag(spec_from_yaml)