Beispiel #1
0
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')
Beispiel #2
0
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')
Beispiel #3
0
def test_compose_abstract():
    schema = Compound.using(field_schema=[String.named(u'y')])
    el = schema()
    el.value
Beispiel #4
0
def test_explode_abstract():
    schema = Compound.using(field_schema=[String.named(u'y')])
    el = schema()
    el.set(u'x')
Beispiel #5
0
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)
Beispiel #6
0
 def __new__(cls, *args, **kw):
     canary.append('new')
     return Compound.__new__(cls, *args, **kw)
Beispiel #7
0
def test_compose_abstract():
    with pytest.raises(NotImplementedError):
        schema = Compound.using(field_schema=[String.named(u'y')])
        el = schema()
        el.value
Beispiel #8
0
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)
Beispiel #9
0
 def __new__(cls, *args, **kw):
     canary.append('new')
     return Compound.__new__(cls, *args, **kw)
Beispiel #10
0
def test_compose_abstract():
    schema = Compound.using(field_schema=[String.named(u'y')])
    el = schema()
    el.value
Beispiel #11
0
def test_explode_abstract():
    schema = Compound.using(field_schema=[String.named(u'y')])
    el = schema()
    el.set(u'x')