[dummy_domain] set an id to dummy_domain
This commit is contained in:
parent
c658815eb5
commit
648841d90f
@ -122,10 +122,10 @@ class HalfAPI:
|
|||||||
logger.debug('Mounting domain %s on %s', domain.get('name'), path)
|
logger.debug('Mounting domain %s on %s', domain.get('name'), path)
|
||||||
self.__application.mount(path,
|
self.__application.mount(path,
|
||||||
HalfDomain(
|
HalfDomain(
|
||||||
self.application,
|
|
||||||
domain.get('name', key),
|
domain.get('name', key),
|
||||||
domain.get('router'),
|
domain.get('router'),
|
||||||
config=domain.get('config', {})
|
domain.get('config', {}),
|
||||||
|
self.application
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ ROUTE_SCHEMA = Schema({
|
|||||||
|
|
||||||
DOMAIN_SCHEMA = Schema({
|
DOMAIN_SCHEMA = Schema({
|
||||||
'name': str,
|
'name': str,
|
||||||
|
'id': str,
|
||||||
Optional('routers'): str,
|
Optional('routers'): str,
|
||||||
Optional('version'): str,
|
Optional('version'): str,
|
||||||
Optional('patch_release'): str,
|
Optional('patch_release'): str,
|
||||||
|
@ -279,8 +279,8 @@ def application_debug(project_runner):
|
|||||||
'production':False,
|
'production':False,
|
||||||
'domain': {
|
'domain': {
|
||||||
'dummy_domain': {
|
'dummy_domain': {
|
||||||
'name': 'test_domain',
|
'name': 'dummy_domain',
|
||||||
'router': 'test_domain.routers',
|
'router': '.routers',
|
||||||
'enabled': True,
|
'enabled': True,
|
||||||
'prefix': False,
|
'prefix': False,
|
||||||
'config':{
|
'config':{
|
||||||
|
@ -2,4 +2,5 @@ __name__ = 'dummy_domain'
|
|||||||
__version__ = '0.0.0'
|
__version__ = '0.0.0'
|
||||||
__patch_release__ = '0.0.0'
|
__patch_release__ = '0.0.0'
|
||||||
__routers__ = '.routers'
|
__routers__ = '.routers'
|
||||||
|
__id__ = '8b88e60a625369235b36c2d6d70756a0c02c1c7fb169fcee6dc820bcf9723f5a'
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import subprocess
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import pprint
|
||||||
from halfapi.lib.constants import API_SCHEMA
|
from halfapi.lib.constants import API_SCHEMA
|
||||||
|
|
||||||
|
|
||||||
@ -25,10 +26,9 @@ def test_routes(application_debug):
|
|||||||
r = c.get('/halfapi/error/500')
|
r = c.get('/halfapi/error/500')
|
||||||
assert r.status_code == 500
|
assert r.status_code == 500
|
||||||
r = c.get('/')
|
r = c.get('/')
|
||||||
print(r.content)
|
|
||||||
d_r = r.json()
|
d_r = r.json()
|
||||||
assert isinstance(d_r, dict)
|
assert isinstance(d_r, dict)
|
||||||
# assert API_SCHEMA.validate(d_r)
|
assert API_SCHEMA.validate(d_r)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
TODO: Find a way to test exception raising
|
TODO: Find a way to test exception raising
|
||||||
|
Loading…
Reference in New Issue
Block a user