[pipfile] remove dependency to python3.8, TODO find a way to specify python>=3.8
This commit is contained in:
parent
15794327f9
commit
a98aa27485
3
Pipfile
3
Pipfile
|
@ -21,8 +21,5 @@ pyyaml = ">=5.3.1,<6"
|
|||
timing-asgi = ">=0.2.1,<1"
|
||||
schema = ">=0.7.4,<1"
|
||||
|
||||
[requires]
|
||||
python_version = "3.8"
|
||||
|
||||
[scripts]
|
||||
halfapi = "python -m halfapi"
|
||||
|
|
|
@ -35,6 +35,13 @@ from halfapi.lib.jwt_middleware import (
|
|||
JWTUser, JWTAuthenticationBackend,
|
||||
JWTWebSocketAuthenticationBackend)
|
||||
|
||||
@pytest.fixture
|
||||
def dummy_domain():
|
||||
yield {
|
||||
'name': 'dummy_domain',
|
||||
'router': 'dummy_domain.routers'
|
||||
}
|
||||
|
||||
@pytest.fixture
|
||||
def token_builder():
|
||||
yield jwt.encode({
|
||||
|
@ -290,31 +297,24 @@ def application_debug(routers):
|
|||
'secret':'turlututu',
|
||||
'production':False,
|
||||
'domain': {
|
||||
'name': 'dummy_domain',
|
||||
'router': 'routers'
|
||||
'name': 'test_domain',
|
||||
'router': 'test_domain.routers'
|
||||
},
|
||||
'config':{
|
||||
'domain_config': {'dummy_domain': {'test': True}}
|
||||
'domain_config': {'test_domain': {'test': True}}
|
||||
}
|
||||
})
|
||||
|
||||
assert isinstance(halfAPI, HalfAPI)
|
||||
return halfAPI.application
|
||||
|
||||
def test_application_debug(application_debug):
|
||||
assert application_debug is not None
|
||||
|
||||
yield halfAPI.application
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def application_domain(routers):
|
||||
def application_domain(dummy_domain):
|
||||
return HalfAPI({
|
||||
'secret':'turlututu',
|
||||
'production':True,
|
||||
'domain': {
|
||||
'name': 'dummy_domain',
|
||||
'router': 'routers'
|
||||
},
|
||||
'domain': dummy_domain,
|
||||
'config':{
|
||||
'domain_config': {'dummy_domain': {'test': True}}
|
||||
}
|
||||
|
|
|
@ -5,12 +5,9 @@ from halfapi.halfapi import HalfAPI
|
|||
|
||||
from halfapi.lib.domain import NoDomainsException
|
||||
|
||||
def test_halfapi_dummy_domain():
|
||||
def test_halfapi_dummy_domain(dummy_domain):
|
||||
with patch('starlette.applications.Starlette') as mock:
|
||||
mock.return_value = MagicMock()
|
||||
halfapi = HalfAPI({
|
||||
'domain': {
|
||||
'name': 'dummy_domain',
|
||||
'router': 'routers'
|
||||
}
|
||||
'domain': dummy_domain
|
||||
})
|
||||
|
|
|
@ -10,14 +10,14 @@ from starlette.testclient import TestClient
|
|||
|
||||
from halfapi.lib.domain import gen_router_routes
|
||||
|
||||
def test_get_config_route(dummy_project, application_domain, routers):
|
||||
def test_get_config_route(dummy_project, application_domain):
|
||||
c = TestClient(application_domain)
|
||||
r = c.get('/config')
|
||||
assert r.status_code == 200
|
||||
pprint(r.json())
|
||||
assert 'test' in r.json()
|
||||
|
||||
def test_get_route(dummy_project, application_domain, routers):
|
||||
def test_get_route(dummy_project, application_domain):
|
||||
c = TestClient(application_domain)
|
||||
path = verb = params = None
|
||||
dummy_domain_routes = [
|
||||
|
@ -73,7 +73,7 @@ def test_get_route(dummy_project, application_domain, routers):
|
|||
assert r.status_code == 200
|
||||
|
||||
|
||||
def test_delete_route(dummy_project, application_domain, routers):
|
||||
def test_delete_route(dummy_project, application_domain):
|
||||
c = TestClient(application_domain)
|
||||
from uuid import uuid4
|
||||
arg = str(uuid4())
|
||||
|
@ -81,7 +81,7 @@ def test_delete_route(dummy_project, application_domain, routers):
|
|||
assert r.status_code == 200
|
||||
assert isinstance(r.json(), str)
|
||||
|
||||
def test_arguments_route(dummy_project, application_domain, routers):
|
||||
def test_arguments_route(dummy_project, application_domain):
|
||||
c = TestClient(application_domain)
|
||||
|
||||
path = '/arguments'
|
||||
|
|
Loading…
Reference in New Issue