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.º 2
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!"
    def test_write_returns_value(self):
        handler = ConstantResultHandler("constant value")

        output = handler.write("a different value")
        assert output == "'constant value'"