示例#1
0
    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!"
示例#2
0
    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"
示例#3
0
 def test_read_returns_value(self):
     handler = ConstantResultHandler("hello world")
     assert handler.read("this param isn't used") == "hello world"