def test_setdefault_without_default_with_non_existent(self): properties = PropertyDict({"name": "Alice"}) value = properties.setdefault("age") assert properties == {"name": "Alice"} assert value is None
def test_setdefault_with_default_with_non_existent(self): properties = PropertyDict({"name": "Alice"}) value = properties.setdefault("age", 33) assert properties == {"name": "Alice", "age": 33} assert value == 33
def test_setdefault_without_default_with_existing(self): properties = PropertyDict({"name": "Alice", "age": 33}) value = properties.setdefault("age") assert properties == {"name": "Alice", "age": 33} assert value == 33