Skip to content

Commit

Permalink
Ruff formatting (#7508)
Browse files Browse the repository at this point in the history
  • Loading branch information
bblommers authored Mar 21, 2024
1 parent 3293b9c commit b22683e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ e00af2f73cb7d27c3755f18b2161b9acbd8ca8aa

# import sorting
ca682c8e5647feacb26f8570f77f1bdb6b5d3b9a

# Ruff formatting
90bdd725552e8cc1466c2b3c1152e0501519a568
1 change: 0 additions & 1 deletion moto/resourcegroupstaggingapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ def format_tag_keys(
"Tags": tags,
}


# Workspaces
if not resource_type_filters or "workspaces" in resource_type_filters:
for ws in self.workspaces_backend.workspaces.values():
Expand Down
1 change: 1 addition & 0 deletions moto/workspaces/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Exceptions raised by the workspaces service."""

from moto.core.exceptions import JsonRESTError


Expand Down
11 changes: 5 additions & 6 deletions moto/workspaces/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""WorkSpacesBackend class with methods for supported APIs."""

import re
from collections.abc import Mapping
from typing import Any, Dict, List, Optional, Tuple
Expand Down Expand Up @@ -88,7 +89,7 @@ def to_dict_pending(self) -> Dict[str, Any]:

def filter_empty_values(self, d: Dict[str, Any]) -> Dict[str, Any]:
if isinstance(d, Mapping):
return dict((k, self.filter_empty_values(v)) for k, v, in d.items() if v)
return dict((k, self.filter_empty_values(v)) for k, v in d.items() if v)
else:
return d

Expand Down Expand Up @@ -455,9 +456,9 @@ def register_workspace_directory(
tenancy=tenancy,
tags=tags,
)
self.workspace_directories[
workspace_directory.directory_id
] = workspace_directory
self.workspace_directories[workspace_directory.directory_id] = (
workspace_directory
)

def describe_workspace_directories(
self, directory_ids: Optional[List[str]] = None
Expand All @@ -479,7 +480,6 @@ def describe_workspace_directories(
def modify_workspace_creation_properties(
self, resource_id: str, workspace_creation_properties: Dict[str, Any]
) -> None:

# Raise Exception if Directory doesnot exist.
if resource_id not in self.workspace_directories:
raise ValidationException("The request is invalid.")
Expand Down Expand Up @@ -530,7 +530,6 @@ def modify_client_properties(
def create_workspace_image(
self, name: str, description: str, workspace_id: str, tags: List[Dict[str, str]]
) -> Dict[str, Any]:

# Check if workspace exists.
if workspace_id not in self.workspaces:
raise ResourceNotFoundException(
Expand Down
1 change: 1 addition & 0 deletions moto/workspaces/responses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Handles incoming workspaces requests, invokes methods, returns responses."""

import json

from moto.core.responses import BaseResponse
Expand Down
1 change: 1 addition & 0 deletions moto/workspaces/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""workspaces base URL and path."""

from .responses import WorkSpacesResponse

url_bases = [
Expand Down
1 change: 1 addition & 0 deletions tests/test_workspaces/test_workspaces.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit tests for workspaces-supported APIs."""

import boto3
import pytest
from botocore.exceptions import ClientError
Expand Down

0 comments on commit b22683e

Please sign in to comment.