def test_merge_semantics(data, s1, s2): assume(canonicalish(s1) != FALSEY and canonicalish(s2) != FALSEY) combined = merged([s1, s2]) assume(combined is not None) assume(combined != FALSEY) note(combined) ic = data.draw(from_schema(combined), label="combined") i1 = data.draw(from_schema(s1), label="s1") i2 = data.draw(from_schema(s2), label="s2") assert is_valid(ic, s1) and is_valid(ic, s2) assert is_valid(i1, s2) == is_valid(i1, combined) assert is_valid(i2, s1) == is_valid(i2, combined)
def test_unable_to_merge(group): assert merged(group) is None
def test_self_merge_eq_canonicalish(schema): m = merged([schema, schema]) assert m == canonicalish(schema)
def test_merged(group, result): assert merged(group) == result