def test_append_item_to_list(self): DataBag.add('foo.bar.baz', [1, 2]) DataBag.add('foo.bar.baz', 3) # append assert DataBag._data['foo']['bar']['baz'] == [1, 2, 3]
def test_add_item(self): DataBag.add('foo.bar.baz', 42) assert 'foo' in DataBag._data assert 'bar' in DataBag._data['foo'] assert 'baz' in DataBag._data['foo']['bar'] assert DataBag._data['foo']['bar']['baz'] is 42
def test_append_item(self): DataBag.add('foo.bar.baz', 42) DataBag.add('foo.bar.baz', True) # append assert DataBag._data['foo']['bar']['baz'] == [42, True]