def test_write_doesnt_overwrite_value(self): handler = ConstantResultHandler("untouchable!") handler.write("a different value") assert handler.value == "untouchable!" assert handler.read("still unused") == "untouchable!"
def test_handles_none_as_constant(self): handler = ConstantResultHandler(None) assert handler.read("still not used") is None output = handler.write("also not used") assert output == "None"
def test_read_returns_value(self): handler = ConstantResultHandler("hello world") assert handler.read("this param isn't used") == "hello world"