Skip to content

Commit

Permalink
Fix linting errors & update existing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
louise-davies authored and root committed Apr 11, 2023
1 parent 49632ea commit fb3d05a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions datagateway_api/src/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import logging

from flask import Flask
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from werkzeug.wrappers import Response

from datagateway_api.src.api_start_utils import (
create_api_endpoints,
Expand All @@ -9,8 +11,7 @@
)
from datagateway_api.src.common.config import Config
from datagateway_api.src.common.logger_setup import setup_logger
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from werkzeug.wrappers import Response


setup_logger()
log = logging.getLogger()
Expand All @@ -24,8 +25,7 @@

if __name__ == "__main__":
app.wsgi_app = DispatcherMiddleware(
Response('Not Found', status=404),
{Config.config.url_prefix: app.wsgi_app}
Response("Not Found", status=404), {Config.config.url_prefix: app.wsgi_app},
)
app.run(
host=Config.config.host,
Expand Down
1 change: 1 addition & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_config_data():
"port": "5000",
"test_user_credentials": {"username": "root", "password": "pw"},
"test_mechanism": "simple",
"url_prefix": "",
}


Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_load_with_same_api_extensions(self, test_config_data):
@pytest.mark.parametrize(
"input_extension, expected_extension",
[
pytest.param("/", "/", id="Slash"),
pytest.param("/", "", id="Slash"),
pytest.param("", "", id="Empty string, implied slash"),
pytest.param("/datagateway-api", "/datagateway-api", id="DataGateway API"),
pytest.param(
Expand Down

0 comments on commit fb3d05a

Please sign in to comment.