auth/test: add missing module db setup

This commit is contained in:
Jimmy Zelinskie 2017-07-06 14:09:02 -04:00
parent da4fb02423
commit 8a6417869d

View file

@ -9,6 +9,7 @@ from initdb import setup_database_for_testing, finished_database_for_testing
from util.morecollections import AttrDict
from util.security.registry_jwt import ANONYMOUS_SUB, build_context_and_subject
TEST_AUDIENCE = app.config['SERVER_HOSTNAME']
TEST_USER = AttrDict({'username': 'joeuser'})
MAX_SIGNED_S = 3660
@ -16,6 +17,14 @@ TOKEN_VALIDITY_LIFETIME_S = 60 * 60 # 1 hour
ANONYMOUS_SUB = '(anonymous)'
def setup_module(m):
setup_database_for_testing(m)
def teardown_module(m):
finished_database_for_testing(m)
def _access(typ='repository', name='somens/somerepo', actions=None):
actions = [] if actions is None else actions
return [{