コード例 #1
0
ファイル: test_compound.py プロジェクト: mbr/flatland0
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
ファイル: test_compound.py プロジェクト: mbr/flatland0
def test_compose_abstract():
    with pytest.raises(NotImplementedError):
        schema = Compound.using(field_schema=[String.named(u'y')])
        el = schema()
        el.value
コード例 #8
0
ファイル: test_compound.py プロジェクト: mbr/flatland0
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
ファイル: test_compound.py プロジェクト: mbr/flatland0
 def __new__(cls, *args, **kw):
     canary.append('new')
     return Compound.__new__(cls, *args, **kw)
コード例 #10
0
ファイル: test_compound.py プロジェクト: dag/flatland
def test_compose_abstract():
    schema = Compound.using(field_schema=[String.named(u'y')])
    el = schema()
    el.value
コード例 #11
0
ファイル: test_compound.py プロジェクト: dag/flatland
def test_explode_abstract():
    schema = Compound.using(field_schema=[String.named(u'y')])
    el = schema()
    el.set(u'x')