def test_handles_none_as_constant(self): constant_result = ConstantResult(value=None) assert constant_result.read("still not used") is constant_result
def test_handles_none_as_constant(self): constant_result = ConstantResult(None) assert constant_result.read("still not used") is None output = constant_result.write() assert output == "None"
def test_read_returns_self(self): constant_result = ConstantResult(value="hello world") assert constant_result.read("this param isn't used") is constant_result
def test_write_doesnt_overwrite_value(self): constant_result = ConstantResult("untouchable!") constant_result.write() assert constant_result.value == "untouchable!" assert constant_result.read("still unused") == "untouchable!"