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
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