From bd473388307bb5aca613ddba046762f3e3d70621 Mon Sep 17 00:00:00 2001 From: Sylvia McLaughlin <85905333+sylviamclaughlin@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:20:54 +0000 Subject: [PATCH] Putting nosec to ignore Bandit security warning on unit tests --- .../google_workspace/test_google_calendar.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/tests/integrations/google_workspace/test_google_calendar.py b/app/tests/integrations/google_workspace/test_google_calendar.py index ccbe5883..07e8a6c7 100644 --- a/app/tests/integrations/google_workspace/test_google_calendar.py +++ b/app/tests/integrations/google_workspace/test_google_calendar.py @@ -501,7 +501,8 @@ def test_get_federal_holidays(requests_mock): {"observedDate": "2024-12-25"}, ] } - requests_mock.get( + # Bandit skip security check for the requests_mock.get call + requests_mock.get( # nosec "https://canada-holidays.ca/api/v1/holidays?federal=true&year=2024", json=mocked_response, ) @@ -518,7 +519,8 @@ def test_get_federal_holidays_with_different_year(requests_mock): # set the timeout to 10s requests_mock.DEFAULT_TIMEOUT = 10 # Mock the API response for a different year - requests_mock.get( + # Bandit skip security check for the requests_mock.get call + requests_mock.get( # nosec "https://canada-holidays.ca/api/v1/holidays?federal=true&year=2025", json={"holidays": []}, ) @@ -541,7 +543,8 @@ def test_api_returns_empty_list(requests_mock): # set the timeout to 10s requests_mock.DEFAULT_TIMEOUT = 10 # Mock no holidays - requests_mock.get( + # Bandit skip security check for the requests_mock.get call + requests_mock.get( # nosec "https://canada-holidays.ca/api/v1/holidays?federal=true&year=2024", json={"holidays": []}, ) @@ -558,7 +561,8 @@ def test_leap_year_handling(requests_mock): # set the timeout to 10s requests_mock.DEFAULT_TIMEOUT = 10 # Mock response for a leap year with an extra day - requests_mock.get( + # Bandit skip security check for the requests_mock.get call + requests_mock.get( # nosec "https://canada-holidays.ca/api/v1/holidays?federal=true&year=2024", json={ "holidays": [