aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/traitlets/py3/tests/utils/test_bunch.py
blob: 223124d7d5e04704db7dd39c4c4fb194f4b85c54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from traitlets.utils.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)