diff --git a/components/server/src/routes/auth.py b/components/server/src/routes/auth.py index cc9ef07055..a1f9a47e1d 100644 --- a/components/server/src/routes/auth.py +++ b/components/server/src/routes/auth.py @@ -14,7 +14,7 @@ from ldap3.core import exceptions from pymongo.database import Database -from database import sessions, reports +from database import sessions from server_utilities.functions import uuid from server_utilities.type import SessionId diff --git a/components/server/tests/initialization/test_bottle.py b/components/server/tests/initialization/test_bottle.py index 11b44e0de6..614a3e1805 100644 --- a/components/server/tests/initialization/test_bottle.py +++ b/components/server/tests/initialization/test_bottle.py @@ -13,6 +13,7 @@ class BottleInitTest(unittest.TestCase): """Unit tests for the bottle initialization.""" def tearDown(self): + """Override to remove the plugins.""" bottle.app().uninstall(True) def test_init(self): diff --git a/components/server/tests/routes/route_plugins/test_route_auth_plugin.py b/components/server/tests/routes/route_plugins/test_route_auth_plugin.py index 7697dbc706..da0249acb3 100644 --- a/components/server/tests/routes/route_plugins/test_route_auth_plugin.py +++ b/components/server/tests/routes/route_plugins/test_route_auth_plugin.py @@ -14,6 +14,7 @@ class AuthPluginTest(unittest.TestCase): """Unit tests for the route authentication and authorization plugin.""" def setUp(self): + """Override to set up a mock database and install the plugins.""" logging.disable() self.mock_database = Mock() self.mock_database.reports_overviews.find_one.return_value = dict(_id="id") @@ -22,6 +23,7 @@ def setUp(self): bottle.install(AuthPlugin()) def tearDown(self): + """Override to remove the plugins and reset the logging.""" bottle.app().uninstall(True) logging.disable(logging.NOTSET) diff --git a/components/server/tests/routes/route_plugins/test_route_injection_plugin.py b/components/server/tests/routes/route_plugins/test_route_injection_plugin.py index 40a7cefbb8..708e97c768 100644 --- a/components/server/tests/routes/route_plugins/test_route_injection_plugin.py +++ b/components/server/tests/routes/route_plugins/test_route_injection_plugin.py @@ -11,6 +11,7 @@ class RouteInjectionPluginTest(unittest.TestCase): """Unit tests for the route injection plugin.""" def tearDown(self): + """Override to remove the plugins.""" bottle.app().uninstall(True) def test_install_plugin(self): @@ -27,6 +28,7 @@ def test_apply_plugin(self): """Test that the plugin can be applied to a route.""" def route(keyword): + """Fake route.""" return keyword bottle.install(InjectionPlugin("value", "keyword")) @@ -37,6 +39,7 @@ def test_apply_plugin_to_route_that_does_not_take_keyword(self): """Test that the plugin can be applied to a route.""" def route(): + """Fake route.""" return "route" bottle.install(InjectionPlugin("value", "keyword")) diff --git a/components/server/tests/routes/test_auth.py b/components/server/tests/routes/test_auth.py index 57c4e51b1c..8cef4de9ee 100644 --- a/components/server/tests/routes/test_auth.py +++ b/components/server/tests/routes/test_auth.py @@ -23,6 +23,7 @@ def setUp(self): self.database = Mock() def tearDown(self): + """Override to remove the cookies and reset the logging.""" bottle.response._cookies = None # pylint: disable=protected-access logging.disable(logging.NOTSET) diff --git a/components/server/tests/routes/test_reports.py b/components/server/tests/routes/test_reports.py index fc87548d77..2a2a447b5b 100644 --- a/components/server/tests/routes/test_reports.py +++ b/components/server/tests/routes/test_reports.py @@ -12,6 +12,7 @@ class ReportsTest(unittest.TestCase): """Unit tests for the reports routes.""" def setUp(self): + """Override to set up a mock database with contents.""" self.database = Mock() self.email = "jenny@example.org" self.other_mail = "john@example.org"