Skip to content

Commit

Permalink
fix: fmt issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharest authored May 27, 2024
1 parent 423532c commit 1ab21bb
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 15 deletions.
1 change: 1 addition & 0 deletions app/integrations/google_workspace/google_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module provides functions to create and manipulate Google Docs.
"""

import logging
import re
from integrations.google_workspace.google_service import (
Expand Down
1 change: 1 addition & 0 deletions app/integrations/google_workspace/google_meet.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
create_google_meet(title: str) -> str:
Starts a Google Meet session and returns the URL of the session.
"""

import re
from datetime import datetime

Expand Down
1 change: 1 addition & 0 deletions app/integrations/google_workspace/google_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Decorator that catches and logs any HttpError or Error exceptions that occur when the decorated function is called.
"""

import os
import logging
import json
Expand Down
1 change: 1 addition & 0 deletions app/integrations/slack/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module contains the user related functionality for the Slack integration.
"""

import re
from slack_sdk import WebClient

Expand Down
1 change: 1 addition & 0 deletions app/integrations/utils/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities for API integrations."""

import re
import string
import random
Expand Down
1 change: 1 addition & 0 deletions app/modules/aws/identity_center.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module to sync the AWS Identity Center with the Google Workspace."""

from logging import getLogger
from integrations.aws import identity_store
from modules.provisioning import groups, entities
Expand Down
1 change: 1 addition & 0 deletions app/modules/dev/google_service.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testing new google service (will be removed)"""

import os
from datetime import datetime, timedelta, timezone
from integrations.google_workspace import (
Expand Down
12 changes: 6 additions & 6 deletions app/modules/incident/incident.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,13 @@ def submit(ack, view, say, body, client, logger):
]

if not re.match(r"^[\w\-\s]+$", name):
errors[
"name"
] = "Description must only contain number and letters // La description ne doit contenir que des nombres et des lettres"
errors["name"] = (
"Description must only contain number and letters // La description ne doit contenir que des nombres et des lettres"
)
if len(name) > 60:
errors[
"name"
] = "Description must be less than 60 characters // La description doit contenir moins de 60 caractères"
errors["name"] = (
"Description must be less than 60 characters // La description doit contenir moins de 60 caractères"
)
if len(errors) > 0:
ack(response_action="errors", errors=errors)
return
Expand Down
8 changes: 5 additions & 3 deletions app/modules/incident/incident_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,11 @@ def channel_item(channel):
"elements": [
{
"type": "mrkdwn",
"text": channel["topic"]["value"]
if channel["topic"]["value"]
else "No information available",
"text": (
channel["topic"]["value"]
if channel["topic"]["value"]
else "No information available"
),
}
],
},
Expand Down
1 change: 1 addition & 0 deletions app/modules/sre/geolocate_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module provides the ability to geolocate an IP address using the maxmind service.
"""

from integrations import maxmind


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit tests for google_directory module."""

from unittest.mock import patch
from integrations.google_workspace import google_directory

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit tests for google_drive module."""

from unittest.mock import patch, call

from integrations.google_workspace import google_drive
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test google_meet.py functions."""

from unittest.mock import patch
from integrations.google_workspace import google_meet

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit Tests for the google_service module."""

import json
from unittest.mock import patch, MagicMock
from json import JSONDecodeError
Expand Down
1 change: 1 addition & 0 deletions app/tests/intergrations/test_google_drive_module.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""NOTE: this module requires a suffix while the intergration/google_drive.py still exists. It should be removed after the integration/google_drive.py is properly refactored with the new google_workspace integration."""

import os
import pytest

Expand Down
14 changes: 8 additions & 6 deletions app/tests/modules/aws/test_sync_identity_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def _provision_entities_side_effect(function, entities, **kwargs):
entities_provisioned.append(
{
"entity": entity["primaryEmail"],
"response": f"membership-{entity['primaryEmail']}"
if execute
else None,
"response": (
f"membership-{entity['primaryEmail']}" if execute else None
),
}
)
elif function_name == "delete_group_membership":
Expand Down Expand Up @@ -147,9 +147,11 @@ def _expected_output(group_users, execute_create, execute_delete):
expected_output[0].append(
{
"entity": user["primaryEmail"],
"response": "membership-" + user["primaryEmail"]
if execute_create
else None,
"response": (
"membership-" + user["primaryEmail"]
if execute_create
else None
),
}
)
for user in group[1]:
Expand Down
1 change: 1 addition & 0 deletions app/utils/filters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains utility functions for filtering lists and dictionaries."""

from functools import reduce
import logging
import re
Expand Down

0 comments on commit 1ab21bb

Please sign in to comment.