示例#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)
示例#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)
示例#3
0
def test_client(db):
    from inbox.api.srv import app
    app.config['TESTING'] = True
    with app.test_client() as c:
        yield c
示例#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)
示例#5
0
文件: base.py 项目: AmyWeiner/inbox
def api_client(db):
    from inbox.api.srv import app
    app.config['TESTING'] = True
    with app.test_client() as c:
        yield TestAPIClient(c)
示例#6
0
文件: base.py 项目: gisho/sync-engine
def webhooks_client(db):
    from inbox.api.srv import app
    app.config['TESTING'] = True
    with app.test_client() as c:
        yield TestWebhooksClient(c)
示例#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
示例#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
示例#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)
示例#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)
示例#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
示例#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)
示例#13
0
def test_client(db):
    from inbox.api.srv import app

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