コード例 #1
0
ファイル: test_drafts.py プロジェクト: raoulwissink/inbox
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
ファイル: conftest.py プロジェクト: ivicac/sync-engine
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
ファイル: test_streaming.py プロジェクト: ivicac/sync-engine
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
ファイル: base.py プロジェクト: devwaker/sync-engine
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
ファイル: base.py プロジェクト: devwaker/sync-engine
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
ファイル: base.py プロジェクト: ivicac/sync-engine
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
ファイル: base.py プロジェクト: nohobby/sync-engine
def test_client(db):
    from inbox.api.srv import app

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