Esempio n. 1
0
def test_struct():
    data = {'hello': 'world'}
    struct = Struct(**data)
    assert struct.hello == 'world'
    assert struct.get('hello') == 'world'
    assert struct.get('unknown', default=42) == 42
    assert repr(struct) == "<hello: 'world'>"
    assert struct.enum() == data
Esempio n. 2
0
def test_struct():
    data = {"hello": "world"}
    struct = Struct(**data)
    assert struct.hello == "world"
    assert struct.get("hello") == "world"
    assert struct.get("unknown", default=42) == 42
    assert repr(struct) == "<hello: 'world'>"
    assert struct.enum() == data