예제 #1
0
 def test_delattr_nested(self):
     items = AttrDict()
     items.a = dict(b=4, c=7)
     del items.a.c
     assert 'b' in items.a
     assert 'c' not in items.a
예제 #2
0
 def test_delattr(self):
     items = AttrDict()
     items.a = 4
     del items.a
     assert 'a' not in items
예제 #3
0
 def test_setattr_getattr(self):
     items = AttrDict()
     items.a = 4
     assert items.a == 4
예제 #4
0
 def test_setattr_getattr_nested(self):
     items = AttrDict()
     items.a = dict(b=4, c=7)
     assert items.a.b == 4
예제 #5
0
 def test_init(self):
     items = AttrDict()
     assert items.keys() == []