def test_compose_abstract_fixme(): with pytest.raises(TypeError): # really it'd be nice if serialize simply wasn't inherited. would # have to rejigger the hierarchy, not sure its worth it. schema = Compound.using(field_schema=[String.named(u'y')]) el = schema() schema.serialize(el, u'abc')
def test_compose_abstract_fixme(): # really it'd be nice if serialize simply wasn't inherited. would # have to rejigger the hierarchy, not sure its worth it. schema = Compound.using(field_schema=[String.named(u'y')]) el = schema() schema.serialize(el, u'abc')
def test_compose_abstract(): schema = Compound.using(field_schema=[String.named(u'y')]) el = schema() el.value
def test_explode_abstract(): schema = Compound.using(field_schema=[String.named(u'y')]) el = schema() el.set(u'x')
def test_repr_always_safe(): # use the abstract class to emulate a subclass with broken compose. broken_impl = Compound.using(field_schema=[String.named(u'y')]) e = broken_impl() assert repr(e)
def __new__(cls, *args, **kw): canary.append('new') return Compound.__new__(cls, *args, **kw)
def test_compose_abstract(): with pytest.raises(NotImplementedError): schema = Compound.using(field_schema=[String.named(u'y')]) el = schema() el.value