def patched_api_client(monkeypatch, db): # We're not testing the actual SMTP sending or syncback with this, so # monkey-patch to make the tests run faster. This is basically the same as # the api_client fixture, but we need to monkeypatch *before* constructing # the fixture for it to work. from inbox.api.srv import app from tests.util.base import TestAPIClient monkeypatch.setattr("inbox.sendmail.base.get_sendmail_client", lambda *args, **kwargs: MockSMTPClient()) monkeypatch.setattr("inbox.actions.save_draft", lambda *args, **kwargs: None) monkeypatch.setattr("inbox.actions.delete_draft", lambda *args, **kwargs: None) app.config["TESTING"] = True with app.test_client() as c: yield TestAPIClient(c)
def webhooks_client(db): from inbox.api.srv import app app.config['TESTING'] = True with app.test_client() as c: yield TestWebhooksClient(c)
def test_client(db): from inbox.api.srv import app app.config['TESTING'] = True with app.test_client() as c: yield c
def api_client(db, default_namespace): from inbox.api.srv import app app.config["TESTING"] = True with app.test_client() as c: yield TestAPIClient(c, default_namespace.public_id)
def api_client(db): from inbox.api.srv import app app.config['TESTING'] = True with app.test_client() as c: yield TestAPIClient(c)
def streaming_test_client(db): from inbox.api.srv import app app.config["TESTING"] = True with app.test_client() as c: yield c
def streaming_test_client(db): from inbox.api.srv import app app.config['TESTING'] = True with app.test_client() as c: yield c
def api_client(db, default_namespace): from inbox.api.srv import app app.config['TESTING'] = True with app.test_client() as c: yield TestAPIClient(c, default_namespace.public_id)
def new_api_client(db, namespace): from inbox.api.srv import app app.config['TESTING'] = True with app.test_client() as c: return TestAPIClient(c, namespace.public_id)
def unauthed_api_client(self, db, default_namespace): from inbox.api.srv import app app.config["TESTING"] = True with app.test_client() as c: yield c
def new_api_client(db, namespace): from inbox.api.srv import app app.config["TESTING"] = True with app.test_client() as c: return TestAPIClient(c, namespace.public_id)
def test_client(db): from inbox.api.srv import app app.config["TESTING"] = True with app.test_client() as c: yield c