2020-10-07 09:52:23 +02:00
|
|
|
import subprocess
|
|
|
|
from pprint import pprint
|
|
|
|
from starlette.testclient import TestClient
|
|
|
|
from starlette.authentication import (
|
|
|
|
AuthenticationBackend, AuthenticationError, BaseUser, AuthCredentials,
|
|
|
|
UnauthenticatedUser)
|
|
|
|
|
|
|
|
from halfapi.app import application
|
|
|
|
from halfapi.lib.schemas import schema_dict_dom
|
|
|
|
|
|
|
|
def test_schemas_dict_dom():
|
2021-05-28 22:30:48 +02:00
|
|
|
from .dummy_domain import routers
|
2020-10-07 09:52:23 +02:00
|
|
|
schema = schema_dict_dom({
|
2021-05-28 22:30:48 +02:00
|
|
|
'dummy_domain':routers})
|
2020-10-07 09:52:23 +02:00
|
|
|
assert isinstance(schema, dict)
|
|
|
|
|
|
|
|
|
|
|
|
def test_get_api_routes(project_runner):
|
|
|
|
c = TestClient(application)
|
|
|
|
r = c.get('/')
|
|
|
|
d_r = r.json()
|
2020-10-07 15:51:24 +02:00
|
|
|
assert isinstance(d_r, dict)
|