aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/traitlets/py2/traitlets/utils/tests/test_bunch.py
blob: ca4357c6746ca4268dda3e8a1465f16b9427a014 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from ..bunch import Bunch 
 
def test_bunch(): 
    b = Bunch(x=5, y=10) 
    assert 'y' in b 
    assert 'x' in b 
    assert b.x == 5 
    b['a'] = 'hi' 
    assert b.a == 'hi' 
 
def test_bunch_dir(): 
    b = Bunch(x=5, y=10) 
    assert 'x' in dir(b) 
    assert 'keys' in dir(b)