Skip to content
Snippets Groups Projects
Commit 00de68d8 authored by Ian Galpin's avatar Ian Galpin
Browse files

Added basic configuration for SQLAlchemy database URI

parent 42d22788
No related branches found
No related tags found
No related merge requests found
......@@ -5,11 +5,23 @@ import jsonschema
CONFIG_SCHEMA = {
'$schema': 'http://json-schema.org/draft-07/schema#',
'type': 'object',
'definitions': {
'database-uri': {
'type': 'string'
}
},
'properties': {
'str-param': {'type': 'string'},
'int-param': {'type': 'integer'}
'SQLALCHEMY_DATABASE_URI': {
'type': 'string',
'properties': {
'database-uri': {'$ref': '#definitions/database-uri'}
},
'additionalProperties': False
},
},
'required': ['str-param', 'int-param'],
'required': ['SQLALCHEMY_DATABASE_URI'],
'additionalProperties': False
}
......
{
"str-param": "some string",
"int-param": -1234
"SQLALCHEMY_DATABASE_URI": "psql://username:password@hostname/db_name"
}
......@@ -10,8 +10,8 @@ import compendium_v2
@pytest.fixture
def data_config_filename():
test_config_data = {
'str-param': 'test data string',
'int-param': -47
'SQLALCHEMY_DATABASE_URI': 'test-uri',
}
with tempfile.NamedTemporaryFile() as f:
f.write(json.dumps(test_config_data).encode('utf-8'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment