def test_nesteddict_fromdict_creates_2level_nesteddict(): d = nesteddict.from_dict( {'a': 1, 'b': {'test':{'inner':1}} }) eq_(d['a'], 1) assert_is_instance(d['b'], nesteddict) eq_(d['b.test.inner'], 1)
def test_nesteddict_fromdict_creates_nesteddict(): d = nesteddict.from_dict( {'a': 1, 'b': {'test':'inner'} }) eq_(d['a'], 1) eq_(d['b.test'], 'inner') eq_(d['b'], {'test': 'inner'})
def test_nesteddict_from_dict_uses_dot_access(): ok_(nesteddict.from_dict({'test.test': True})['test.test'])
def test_nesteddict_fromdict_creates_2level_nesteddict(): d = nesteddict.from_dict({'a': 1, 'b': {'test': {'inner': 1}}}) eq_(d['a'], 1) assert_is_instance(d['b'], nesteddict) eq_(d['b.test.inner'], 1)
def test_nesteddict_fromdict_creates_nesteddict(): d = nesteddict.from_dict({'a': 1, 'b': {'test': 'inner'}}) eq_(d['a'], 1) eq_(d['b.test'], 'inner') eq_(d['b'], {'test': 'inner'})