def test__restore__causes_the_spy_to_return_none(): spy = Spy() spy.then_return("some value") expect(spy("anything", ["can"], go="here")).to_be("some value") spy.restore() expect(spy("anything", ["can"], go="here")).to_be_none()
def test__restore__resets_what_the_spy_was_last_called_with(): spy = Spy() spy("anything", ["can"], go="here") expect(spy.last_call).to_be((("anything", ["can"]), {"go": "here"})) spy.restore() expect(spy.last_call).to_be_none()