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