From 946c8fab774dbd455eeccabacb6fcf829eb78736 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Tue, 12 Sep 2023 14:40:58 +0200 Subject: [PATCH] Remove redundant test --- gilda/app/app.py | 5 ----- gilda/tests/test_app.py | 4 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/gilda/app/app.py b/gilda/app/app.py index d497f9a..ba16192 100644 --- a/gilda/app/app.py +++ b/gilda/app/app.py @@ -8,8 +8,6 @@ from gilda.grounder import GrounderInput, Grounder from gilda.app.proxies import grounder -GILDA_USING_UI = "GILDA_USING_UI" - # NOTE: the Flask REST-X API has to be declared here, below the home endpoint # otherwise it reserves the / base path. @@ -289,7 +287,6 @@ def get_app(terms: Optional[GrounderInput] = None, *, ui: bool = True) -> Flask: else: Bootstrap(app) app.register_blueprint(ui_blueprint, url_prefix="/") - app.config[GILDA_USING_UI] = True # has to be put after defining the UI blueprint otherwise it reserves "/" api.init_app(app) @@ -297,8 +294,6 @@ def get_app(terms: Optional[GrounderInput] = None, *, ui: bool = True) -> Flask: def _mount_home_redirect(app): - app.config[GILDA_USING_UI] = False - @app.route("/") def home_redirect(): """Redirect the home url to the API documentation.""" diff --git a/gilda/tests/test_app.py b/gilda/tests/test_app.py index b60c010..65f3448 100644 --- a/gilda/tests/test_app.py +++ b/gilda/tests/test_app.py @@ -5,7 +5,7 @@ import flask -from gilda.app.app import get_app, GILDA_USING_UI +from gilda.app.app import get_app class TestApp(unittest.TestCase): @@ -19,7 +19,6 @@ def setUpClass(cls) -> None: def test_get_home(self): """Test the GET response on the home page.""" - self.assertTrue(self.app.config[GILDA_USING_UI]) with self.app.test_client() as client: res = client.get("/?text=Raf1") self.assertNotEqual( @@ -31,7 +30,6 @@ def test_get_home(self): def test_post_home(self): """Test the POST response on the home page.""" - self.assertTrue(self.app.config[GILDA_USING_UI]) with self.app.test_client() as client: res = client.post("/", json={"text": "Raf1"}) self.assertNotEqual(