Exemplo n.º 1
0
    def test_context_manager(self):
        api = Symantec("user", "p@ssw0rd")
        api.close = pretend.call_recorder(lambda: None)

        with api as ctx_api:
            assert ctx_api is api

        assert api.close.calls == [pretend.call()]
Exemplo n.º 2
0
    def test_session_close(self):
        api = Symantec("user", "p@ssw0rd")
        api.session = pretend.stub(close=pretend.call_recorder(lambda: None))
        api.close()

        assert api.session.close.calls == [pretend.call()]