Remove unuseful func

Remove unuseful func and fix unit test error.

Change-Id: Ibf2a60ac110a95e4cccdc73d9edb7522d6c7b43b
This commit is contained in:
Cai Hui 2021-11-02 20:26:09 +08:00
parent ee8fc485e7
commit 8e67288166
2 changed files with 22 additions and 22 deletions

View File

@ -66,27 +66,27 @@ def configure_app(app, db=None):
return app return app
def build_app_v0(): # def build_app_v0():
"""Instantiate the root freezer-api app # """Instantiate the root freezer-api app
Old versions of falcon (< 0.2.0) don't have a named 'middleware' argument. # Old versions of falcon (< 0.2.0) don't have a named 'middleware' argument.
This was introduced in version 0.2.0b1, so before that we need to instead # This was introduced in version 0.2.0b1, so before that we need to instead
provide "before" hooks (request processing) and "after" hooks (response # provide "before" hooks (request processing) and "after" hooks (response
processing). # processing).
:return: falcon WSGI app # :return: falcon WSGI app
""" # """
# injecting FreezerContext & hooks # # injecting FreezerContext & hooks
before_hooks = utils.before_hooks() + [ # before_hooks = utils.before_hooks() + [
middleware.RequireJSON().as_before_hook()] # middleware.RequireJSON().as_before_hook()]
after_hooks = [middleware.JSONTranslator().as_after_hook()] # after_hooks = [middleware.JSONTranslator().as_after_hook()]
# The signature of falcon.API() differs between versions, suppress pylint: # # The signature of falcon.API() differs between versions, suppress pylint:
# pylint: disable=unexpected-keyword-arg # # pylint: disable=unexpected-keyword-arg
app = falcon.API(before=before_hooks, after=after_hooks) # app = falcon.API(before=before_hooks, after=after_hooks)
app = configure_app(app) # app = configure_app(app)
return app # return app
def build_app_v1(): def build_app_v1():

View File

@ -26,7 +26,7 @@ from migrate.versioning import api as migration_api
from migrate.versioning import repository from migrate.versioning import repository
from oslo_db.sqlalchemy import test_migrations from oslo_db.sqlalchemy import test_migrations
from oslo_db.sqlalchemy import utils as db_utils from oslo_db.sqlalchemy import utils as db_utils
from oslo_db.tests.sqlalchemy import base as test_base # from oslo_db.tests.sqlalchemy import base as test_base
import sqlalchemy import sqlalchemy
from sqlalchemy.engine import reflection from sqlalchemy.engine import reflection
@ -357,10 +357,10 @@ class MigrationsMixin(test_migrations.WalkVersionsMixin):
self.assert_each_foreign_key_is_part_of_an_index() self.assert_each_foreign_key_is_part_of_an_index()
class TestSqliteMigrations(test_base.DbTestCase, # class TestSqliteMigrations(test_base.DbTestCase,
MigrationsMixin): # MigrationsMixin):
def assert_each_foreign_key_is_part_of_an_index(self): # def assert_each_foreign_key_is_part_of_an_index(self):
# Skip the test for SQLite because SQLite does not list # Skip the test for SQLite because SQLite does not list
# UniqueConstraints as indexes, which makes this test fail. # UniqueConstraints as indexes, which makes this test fail.
# Given that SQLite is only for testing purposes, it is safe to skip # Given that SQLite is only for testing purposes, it is safe to skip
pass # pass