Skip to content

Commit

Permalink
Fixing unit test and removing unessessary explicit toString call
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-moore-97 committed Oct 18, 2023
1 parent f3edb8b commit 4aa4d22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions gdrive/analytics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ async def run_analytics(background_tasks: BackgroundTasks, req: AnalyticsRequest
)

except ValueError as err:
message = str(err)
return responses.JSONResponse(
status_code=422,
content="Failed (invalid date parameters): [%s, %s] %s"
% (req.startDate, req.endDate, message),
content="Failed (invalid date parameters): %s" % (err),

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from fastapi import testclient

# pylint: disable=wrong-import-position
sys.modules["gdrive.client"] = MagicMock()
sys.modules["gdrive.drive_client"] = MagicMock()
from gdrive import main

client = testclient.TestClient(main.app)
Expand Down

0 comments on commit 4aa4d22

Please sign in to comment.