Exemplo n.º 1
0
 def test_setdefault_with_default_with_non_existent(self):
     properties = PropertySet({"name": "Alice"})
     value = properties.setdefault("age", 33)
     assert properties == {"name": "Alice", "age": 33}
     assert value == 33
Exemplo n.º 2
0
 def test_setdefault_without_default_with_non_existent(self):
     properties = PropertySet({"name": "Alice"})
     value = properties.setdefault("age")
     assert properties == {"name": "Alice", "age": None}
     assert value is None
Exemplo n.º 3
0
 def test_setdefault_without_default_with_existing(self):
     properties = PropertySet({"name": "Alice", "age": 33})
     value = properties.setdefault("age")
     assert properties == {"name": "Alice", "age": 33}
     assert value == 33
Exemplo n.º 4
0
 def test_setdefault_with_default_with_non_existent(self):
     properties = PropertySet({"name": "Alice"})
     value = properties.setdefault("age", 33)
     assert properties == {"name": "Alice", "age": 33}
     assert value == 33
Exemplo n.º 5
0
 def test_setdefault_without_default_with_non_existent(self):
     properties = PropertySet({"name": "Alice"})
     value = properties.setdefault("age")
     assert properties == {"name": "Alice", "age": None}
     assert value is None
Exemplo n.º 6
0
 def test_setdefault_without_default_with_existing(self):
     properties = PropertySet({"name": "Alice", "age": 33})
     value = properties.setdefault("age")
     assert properties == {"name": "Alice", "age": 33}
     assert value == 33