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