Example #1
0
 def test_items_dict(self):
     config = ConfigNode({'foo': 1, 'bar': 2})
     compare(config.items(), expected=[('bar', 2), ('foo', 1)])
Example #2
0
 def test_items_wrapped_value(self):
     config = ConfigNode({'foo': [1]})
     obj = tuple(config.items())[0][1]
     assert isinstance(obj, ConfigNode)
     compare(obj.data, expected=[1])
Example #3
0
 def test_items_list(self):
     config = ConfigNode([])
     expected = "'list' object has no attribute 'items'"
     with ShouldRaise(AttributeError(expected)):
         tuple(config.items())
Example #4
0
 def test_items_list(self):
     config = ConfigNode([])
     expected = "'list' object has no attribute 'items'"
     with ShouldRaise(AttributeError(expected)):
         tuple(config.items())
Example #5
0
 def test_items_dict(self):
     config = ConfigNode({'foo': 1, 'bar': 2})
     compare(config.items(), expected=[('bar', 2), ('foo', 1)])
Example #6
0
 def test_items_wrapped_value(self):
     config = ConfigNode({'foo': [1]})
     obj = tuple(config.items())[0][1]
     assert isinstance(obj, ConfigNode)
     compare(obj.data, expected=[1])