How to use the schemathesis.from_uri function in schemathesis

To help you get started, we’ve selected a few schemathesis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kiwicom / schemathesis / test / test_parametrizer.py View on Github external
    "method, path", ((schemathesis.from_path, SIMPLE_PATH), (schemathesis.from_uri, f"file://{SIMPLE_PATH}"))
)
def test_alternative_constructors(simple_schema, method, path):
    assert method(path).raw_schema == simple_schema
github kiwicom / schemathesis / test / test_loaders.py View on Github external
def test_uri_loader(app_schema, app, schema_url):
    # Each loader method should read the specified schema correctly
    assert schemathesis.from_uri(schema_url).raw_schema == app_schema
github kiwicom / schemathesis / test / test_loaders.py View on Github external
def test_uri_loader_custom_kwargs(app, schema_url):
    # All custom kwargs are passed to `requests.get`
    schemathesis.from_uri(schema_url, verify=False, headers={"X-Test": "foo"})
    request = app["schema_requests"][0]
    assert request.headers["X-Test"] == "foo"
    assert request.headers["User-Agent"] == USER_AGENT
github kiwicom / schemathesis / test / test_loaders.py View on Github external
def test_base_url(base_url, schema_url):
    schema = schemathesis.from_uri(schema_url)
    assert schema.base_url == base_url
github kiwicom / schemathesis / test / test_loaders.py View on Github external
def test_base_url_override(schema_url, url):
    schema = schemathesis.from_uri(schema_url, base_url=url)
    endpoint = next(schema.get_all_endpoints())
    assert endpoint.base_url == "http://example.com"