Skip to content

Commit

Permalink
Fix quality issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniessink committed Nov 24, 2020
1 parent 006b5ac commit 121fe7a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/server/src/routes/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions components/server/tests/initialization/test_bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"))
Expand All @@ -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"))
Expand Down
1 change: 1 addition & 0 deletions components/server/tests/routes/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions components/server/tests/routes/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 121fe7a

Please sign in to comment.