Example #1
0
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)
Example #2
0
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'})
Example #3
0
def test_nesteddict_from_dict_uses_dot_access():
    ok_(nesteddict.from_dict({'test.test': True})['test.test'])
Example #4
0
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)
Example #5
0
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'})
Example #6
0
def test_nesteddict_from_dict_uses_dot_access():
	ok_(nesteddict.from_dict({'test.test': True})['test.test'])