Skip to content

Commit

Permalink
fix: cleaning static files
Browse files Browse the repository at this point in the history
commit a698ef651890665060ce76b61aab42511a008b26
Author: Maximiliano Osorio <maxiosorio@gmail.com>
Date:   Thu Apr 23 08:20:11 2020 -0700

    fix: removing config options

commit 7954ec630ab3826a052486adf73ada2e1791e736
Author: Maximiliano Osorio <maxiosorio@gmail.com>
Date:   Thu Apr 23 08:17:49 2020 -0700

    test
  • Loading branch information
mosoriob committed Apr 23, 2020
1 parent 4ac8296 commit a44f735
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 59 deletions.
Original file line number Diff line number Diff line change
@@ -1,74 +1,28 @@
import logging

import connexion
from connexion.spec import Specification
from flask_testing import TestCase
from obasparql import QueryManager

from {{packageName}}.encoder import JSONEncoder
from {{packageName}}.cached import CachedSpecification
from {{packageName}} import QUERY_DIRECTORY, CONTEXT_DIRECTORY, QUERIES_TYPES

query_manager = QueryManager(queries_dir=QUERY_DIRECTORY,
context_dir=CONTEXT_DIRECTORY,
queries_types=QUERIES_TYPES)
from {{packageName}}.encoder import JSONEncoder

import logging.config
import os

# Disable Django's logging setup
LOGGING_CONFIG = None

LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper()

logging.config.dictConfig({
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'default': {
# exact format is not important, this is the minimum information
'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
},
},
'handlers': {
# console logs to stderr
'console': {
'class': 'logging.StreamHandler',
'formatter': 'default',
},
},
'loggers': {
# default for all undefined Python modules
'': {
'level': 'WARNING',
'handlers': ['console'],
},
# Our application code
'openapi_server': {
'level': LOGLEVEL,
'handlers': ['console'],
# Avoid double logging because of root logger
'propagate': False,
},
# Prevent noisy modules from logging to Sentry
'noisy_module': {
'level': 'ERROR',
'handlers': ['console'],
'propagate': False,
},
},
})
logger = logging.getLogger(__name__)


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):
logging.getLogger('connexion.operation').setLevel('ERROR')
Specification.from_file = CachedSpecification.from_file
app = connexion.App(__name__, specification_dir='../openapi/')
app.app.json_encoder = JSONEncoder
app.add_api('openapi.yaml',
app.add_api('openapi.yaml',
pythonic_params=True,
pythonic_params=False,
strict_validation=True)
validate_responses=True)
return app.app
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[defaults]
endpoint = http://dbpedia.org/sparql
endpoint =
queries_dir = queries/
context_dir = contexts/
prefix = http://dbpedia.org/resource
prefix =
graph_base =

0 comments on commit a44f735

Please sign in to comment.