diff --git a/app/modules/dev/google_service.py b/app/modules/dev/google_service.py index f27bceda..2f22af7f 100644 --- a/app/modules/dev/google_service.py +++ b/app/modules/dev/google_service.py @@ -1,10 +1,7 @@ """Testing new google service (will be removed)""" import os -import json from datetime import datetime, timedelta, timezone from integrations.google_workspace import ( - google_directory, - google_drive, google_calendar, ) from dotenv import load_dotenv @@ -68,8 +65,10 @@ def google_service_command(ack, client, body, respond): time_max = (now + timedelta(days=(60 + days))).isoformat() freebusy_results = google_calendar.get_freebusy(time_min, time_max, items) # respond(freebusy_results) - first_available_start, first_available_end = google_calendar.find_first_available_slot( - freebusy_results, days) + ( + first_available_start, + first_available_end, + ) = google_calendar.find_first_available_slot(freebusy_results, days) respond(f"First available slot: {first_available_start} to {first_available_end}") # respond(f"Healthcheck status: {google_drive.healthcheck()}") diff --git a/app/tests/integrations/google_workspace/test_google_calendar.py b/app/tests/integrations/google_workspace/test_google_calendar.py index bbb7e52e..267c881d 100644 --- a/app/tests/integrations/google_workspace/test_google_calendar.py +++ b/app/tests/integrations/google_workspace/test_google_calendar.py @@ -64,7 +64,10 @@ def items(): return [{"id": "calendar1"}, {"id": "calendar2"}] -@patch("integrations.google_workspace.google_calendar.DEFAULT_DELEGATED_ADMIN_EMAIL", "test_email") +@patch( + "integrations.google_workspace.google_calendar.DEFAULT_DELEGATED_ADMIN_EMAIL", + "test_email", +) @patch("integrations.google_workspace.google_calendar.execute_google_api_call") def test_get_freebusy_required_args_only(mock_execute_google_api_call, items): mock_execute_google_api_call.return_value = {} @@ -88,7 +91,10 @@ def test_get_freebusy_required_args_only(mock_execute_google_api_call, items): ) -@patch("integrations.google_workspace.google_calendar.DEFAULT_DELEGATED_ADMIN_EMAIL", "test_email") +@patch( + "integrations.google_workspace.google_calendar.DEFAULT_DELEGATED_ADMIN_EMAIL", + "test_email", +) @patch("integrations.google_workspace.google_calendar.execute_google_api_call") def test_get_freebusy_optional_args(mock_execute_google_api_call, items): mock_execute_google_api_call.return_value = {}