Buckets:

download
raw
1.2 kB
import pytest
from starlette.status import HTTP_200_OK
from tiled.adapters.mapping import MapAdapter
from tiled.client import Context
from tiled.server.app import build_app_from_config
from .conftest import TOY_AUTHENTICATION
# Basic authenticated server config
tree = MapAdapter({})
config = {
"authentication": TOY_AUTHENTICATION,
"trees": [
{
"tree": f"{__name__}:tree",
"path": "/",
},
],
}
@pytest.fixture
def context():
with Context.from_app(build_app_from_config(config)) as context:
yield context
def test_openapi_username_password_login(context):
"""
Ensure that tokenUrl is a valid path.
The tokenUrl is set manually because of when in the server lifecycle it is
known, and the point of this test is to ensure it does not bit rot to some
invalid path, because that has happened before.
"""
response = context.http_client.get("/openapi.json")
assert response.status_code == HTTP_200_OK
openapi = response.json()
token_url = openapi["components"]["securitySchemes"]["OAuth2PasswordBearer"][
"flows"
]["password"]["tokenUrl"]
assert token_url in openapi["paths"]

Xet Storage Details

Size:
1.2 kB
·
Xet hash:
b2b6a681060e274d39cada16978fe6e22c423d419198926c9db1cb42af106cbd

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.