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