def test_copy_default_factory(): undefined = lambda: object() m = DefaultFactoryMunch.fromDict({'urmom': {'sez': {'what': 'what'}}}, undefined) c = m.copy() assert c is not m assert c.urmom is not m.urmom assert c.urmom.sez is not m.urmom.sez assert c.urmom.sez.what == 'what' assert c == m
def test_fromDict_default_factory(): obj = object() undefined = lambda: obj b = DefaultFactoryMunch.fromDict({'urmom': { 'sez': { 'what': 'what' } }}, undefined) assert b.urmom.sez.what == 'what' assert b.urmom.sez.foo is undefined()
def test_fromDict_default_factory(): obj = object() undefined = lambda: obj b = DefaultFactoryMunch.fromDict({'urmom': {'sez': {'what': 'what'}}}, undefined) assert b.urmom.sez.what == 'what' assert b.urmom.sez.foo is undefined()