forked from KnowledgeCaptureAndDiscovery/OBA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffb2a69
commit 647bae7
Showing
17 changed files
with
135 additions
and
145 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +0,0 @@ | ||
from obasparql import QueryManager | ||
from {{packageName}}.settings import * | ||
import logging | ||
|
||
try: | ||
logging.config.fileConfig(logging_file) | ||
except: | ||
logging.error("Logging config file does not exist {}".format(logging_file)) | ||
exit(0) | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
query_manager = QueryManager(queries_dir=QUERY_DIRECTORY, | ||
context_dir=CONTEXT_DIRECTORY, | ||
endpoint=ENDPOINT, | ||
endpoint_username=ENDPOINT_USERNAME, | ||
endpoint_password=ENDPOINT_PASSWORD, | ||
named_graph_base=ENDPOINT_GRAPH_BASE, | ||
uri_prefix=ENDPOINT_RESOURCE_PREFIX) | ||
|
||
33 changes: 4 additions & 29 deletions
33
src/main/resources/servers/python/.openapi-generator/template/__init__test.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,16 @@ | ||
import logging | ||
from pathlib import Path | ||
|
||
import connexion | ||
from flask_testing import TestCase | ||
from {{packageName}}.cached import CachedSpecification | ||
from {{packageName}}.encoder import JSONEncoder | ||
from {{packageName}}.settings import * | ||
from connexion.spec import Specification | ||
|
||
import logging.config | ||
from obasparql import QueryManager | ||
|
||
|
||
query_manager = QueryManager(queries_dir=QUERY_DIRECTORY, | ||
context_dir=CONTEXT_DIRECTORY, | ||
queries_types=QUERIES_TYPES, | ||
endpoint=ENDPOINT, | ||
endpoint_username=ENDPOINT_USERNAME, | ||
endpoint_password=ENDPOINT_PASSWORD, | ||
graph_base=ENDPOINT_GRAPH_BASE, | ||
prefix=ENDPOINT_RESOURCE_PREFIX) | ||
|
||
from {{packageName}}.encoder import JSONEncoder | ||
|
||
|
||
class BaseTestCase(TestCase): | ||
logging_file = Path(__file__).parent.parent / "settings" / "logging.ini" | ||
try: | ||
logging.config.fileConfig(logging_file) | ||
except: | ||
logging.error("Logging config file does not exist {}".format(logging_file)) | ||
exit(0) | ||
logger = logging.getLogger(__name__) | ||
|
||
def create_app(self): | ||
Specification.from_file = CachedSpecification.from_file | ||
logging.getLogger('connexion.operation').setLevel('ERROR') | ||
app = connexion.App(__name__, specification_dir='../openapi/') | ||
app.app.json_encoder = JSONEncoder | ||
app.add_api('openapi.yaml', | ||
pythonic_params=False, | ||
validate_responses=True) | ||
app.add_api('openapi.yaml', pythonic_params=True) | ||
return app.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,9 @@ coverage.xml | |
*,cover | ||
.hypothesis/ | ||
venv/ | ||
.venv/ | ||
.python-version | ||
.pytest_cache | ||
|
||
# Translations | ||
*.mo | ||
|
Oops, something went wrong.