def app(mocking_app): return mocking_app( "tests/serve/mock/end-to-end/opbank/callbacks", load_specs("tests/serve/mock/end-to-end/opbank/schemas"), HeaderRouting(), Log(Scope()), )
def app(mocking_app, test_sink): return mocking_app( "tests/serve/mock/callbacks", load_specs("tests/serve/mock/schemas/fails"), HeaderRouting(), Log(Scope(), test_sink), )
def app(mocking_app): return mocking_app( "tests/serve/mock/callbacks", load_specs("tests/serve/mock/schemas/petstore"), StaticRouting("http://petstore.swagger.io"), log=Log(Scope()), )
def app(mocking_app): return mocking_app( "tests/serve/mock/callbacks", load_specs("tests/serve/mock/schemas/petstore"), HeaderRouting(), Log(Scope()), )
def app(mocking_app): return mocking_app( "tests/serve/mock/callbacks", load_specs("tests/serve/mock/schemas/stripe"), PathRouting(), Log(Scope()), )
import logging import pytest from hamcrest import assert_that, has_key, is_ from tornado.httpclient import HTTPClientError, HTTPRequest from hmt.serve.mock.log import Log from hmt.serve.mock.scope import Scope from hmt.serve.mock.specs import load_specs from hmt.serve.utils.routing import PathRouting logger = logging.getLogger(__name__) logging.basicConfig(level="DEBUG") routing = PathRouting() log = Log(Scope()) specs = load_specs("tests/serve/mock/schemas/nordea") @pytest.fixture def app(mocking_app): return mocking_app( None, specs, PathRouting(), log, ) def make_sandbox_url(base_url, path: str): return f"{base_url}/https://api.nordeaopenbanking.com{path}"
import pytest from openapi_typed_2 import convert_to_OpenAPIObject from tornado.httpclient import HTTPClientError, HTTPRequest from hmt.serve.admin import make_admin_app from hmt.serve.mock.scope import Scope from hmt.serve.mock.specs import OpenAPISpecification from tests.util import spec_dict scope = Scope() @pytest.fixture def app(mock_data_store, rest_middleware_manager): return make_admin_app(scope, mock_data_store, rest_middleware_manager) @pytest.fixture(autouse=True) def setup(): yield True scope.clear() @pytest.mark.gen_test def test_storage(mock_data_store, http_client, base_url): schema = {"$ref": "#/components/schemas/item"} components = { "schemas": { "item": { "type": "object",