Skip to content

Commit

Permalink
chore: run fmt & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharest authored Apr 22, 2024
1 parent 8d93bcf commit e98fcd8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 4 additions & 5 deletions app/modules/dev/google_service.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()}")
Expand Down
10 changes: 8 additions & 2 deletions app/tests/integrations/google_workspace/test_google_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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 = {}
Expand Down

0 comments on commit e98fcd8

Please sign in to comment.