Ejemplo n.º 1
0
 def test_items_dict(self):
     config = ConfigNode({'foo': 1, 'bar': 2})
     compare(config.items(), expected=[('bar', 2), ('foo', 1)])
Ejemplo n.º 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])
Ejemplo n.º 3
0
 def test_items_list(self):
     config = ConfigNode([])
     expected = "'list' object has no attribute 'items'"
     with ShouldRaise(AttributeError(expected)):
         tuple(config.items())
Ejemplo n.º 4
0
 def test_items_list(self):
     config = ConfigNode([])
     expected = "'list' object has no attribute 'items'"
     with ShouldRaise(AttributeError(expected)):
         tuple(config.items())
Ejemplo n.º 5
0
 def test_items_dict(self):
     config = ConfigNode({'foo': 1, 'bar': 2})
     compare(config.items(), expected=[('bar', 2), ('foo', 1)])
Ejemplo n.º 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])