Esempio n. 1
0
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)
Esempio n. 2
0
def webhooks_client(db):
    from inbox.api.srv import app
    app.config['TESTING'] = True
    with app.test_client() as c:
        yield TestWebhooksClient(c)
Esempio n. 3
0
def test_client(db):
    from inbox.api.srv import app
    app.config['TESTING'] = True
    with app.test_client() as c:
        yield c
Esempio n. 4
0
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)
Esempio n. 5
0
def api_client(db):
    from inbox.api.srv import app
    app.config['TESTING'] = True
    with app.test_client() as c:
        yield TestAPIClient(c)
Esempio n. 6
0
def webhooks_client(db):
    from inbox.api.srv import app
    app.config['TESTING'] = True
    with app.test_client() as c:
        yield TestWebhooksClient(c)
Esempio n. 7
0
def streaming_test_client(db):
    from inbox.api.srv import app

    app.config["TESTING"] = True
    with app.test_client() as c:
        yield c
Esempio n. 8
0
def streaming_test_client(db):
    from inbox.api.srv import app
    app.config['TESTING'] = True
    with app.test_client() as c:
        yield c
Esempio n. 9
0
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)
Esempio n. 10
0
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)
Esempio n. 11
0
    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
Esempio n. 12
0
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)
Esempio n. 13
0
def test_client(db):
    from inbox.api.srv import app

    app.config["TESTING"] = True
    with app.test_client() as c:
        yield c