Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions moto/cloudwatch/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def physical_resource_id(self) -> str:

class Statistics:
"""
Helper class to calculate statics for a list of metrics (MetricDatum, or MetricAggregatedDatum)
Helper class to calculate statistics for a list of metrics (MetricDatum, or MetricAggregatedDatum)
"""

def __init__(self, stats: list[str], dt: datetime, unit: str | None = None):
Expand All @@ -393,7 +393,7 @@ def __init__(self, stats: list[str], dt: datetime, unit: str | None = None):
def get_statistics_for_type(self, stat: str) -> SupportsFloat | None:
"""Calculates the statistic for the metric_data provided

:param stat: the statistic that should be returned, case-sensitive (Sum, Average, Minium, Maximum, SampleCount)
:param stat: the statistic that should be returned, case-sensitive (Sum, Average, Minimum, Maximum, SampleCount)
:return: the statistic of the current 'metric_data' in this class, or 0
"""
if stat == "Sum":
Expand Down
2 changes: 1 addition & 1 deletion moto/codebuild/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def start_build(

self.build_history[project_name].append(build_id)

# update build histroy with metadata for build id
# update build history with metadata for build id
self.build_metadata_history[project_name].append(
self.build_metadata[project_name].build_metadata
)
Expand Down
4 changes: 2 additions & 2 deletions moto/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def convert_to_class_args(dict_arg: dict[str, Any]) -> dict[str, Any]:
"""Return dict that can be used to instantiate it's representative class.

Given a dictionary in the incoming API request, convert the keys to
snake case to use as arguments when instatiating the representative
snake case to use as arguments when instantiating the representative
class's __init__().
"""
class_args = {}
Expand Down Expand Up @@ -499,7 +499,7 @@ class Scope(ConfigEmptyDictable):
- combo of one resource type and one resource ID,
- combo of tag key and value.

If no scope is specified, evaluations are trigged when any resource
If no scope is specified, evaluations are triggered when any resource
in the recording group changes.
"""

Expand Down
2 changes: 1 addition & 1 deletion moto/ds/validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def validate_args(validators: Any) -> None:
"remoteDomainName": validate_remote_domain_name,
}
err_msgs = []
# This eventually could be a switch (python 3.10), elminating the need
# This eventually could be a switch (python 3.10), eliminating the need
# for the above map and individual functions.
for fieldname, value in validators:
msg = validation_map[fieldname](value)
Expand Down
2 changes: 1 addition & 1 deletion moto/dynamodb/models/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ def query(
else:
processing_previous_page = False

# Check wether we've reached the limit of our result set
# Check whether we've reached the limit of our result set
# That can be either in number, or in size
reached_length_limit = len(results) == limit
reached_size_limit = (result_size + result.size()) > RESULT_SIZE_LIMIT
Expand Down
2 changes: 1 addition & 1 deletion moto/dynamodb/parsing/ast_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def to_str(self):


class ExpressionSelector(LeafNode):
"""Node identifying selector [selection_index] in expresion"""
"""Node identifying selector [selection_index] in expression"""

def __init__(self, selection_index):
try:
Expand Down
2 changes: 1 addition & 1 deletion moto/glue/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ def status(self) -> str:
return "STOPPING"
else:
raise RuntimeError(
f"Unexpeected state found for crawler, found state {self.crawls[-1].status}"
f"Unexpected state found for crawler, found state {self.crawls[-1].status}"
)


Expand Down
8 changes: 4 additions & 4 deletions moto/lakeformation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __init__(self) -> None:
def add_permission(self, permission: Permission) -> None:
for existing_permission in self.permissions:
if permission.equal_principal_and_resouce(existing_permission):
# Permission with same principal and resouce, only once of these can exist
# Permission with same principal and resource, only once of these can exist
existing_permission.merge(permission)
return
# found no match
Expand All @@ -118,8 +118,8 @@ def add_permission(self, permission: Permission) -> None:
def remove_permission(self, permission: Permission) -> None:
for existing_permission in self.permissions:
if permission.equal_principal_and_resouce(existing_permission):
# Permission with same principal and resouce, only once of these can exist
# remove and readd to recalculate the hash value after the diff
# Permission with same principal and resource, only once of these can exist
# remove and re-add to recalculate the hash value after the diff
self.permissions.remove(existing_permission)
existing_permission.diff(permission)
self.permissions.add(existing_permission)
Expand Down Expand Up @@ -231,7 +231,7 @@ def __init__(
and table is None
and data_location is None
):
# Error message is the exact string returned by the AWS-CLI eventhough it is valid
# Error message is the exact string returned by the AWS-CLI even though it is valid
# to not populate the respective fields as long as data_location is given.
raise InvalidInput(
"Resource must have either the catalog, table or database field populated."
Expand Down
4 changes: 2 additions & 2 deletions moto/route53resolver/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def _verify_subnet_ips(

NOTE: This does not include IPv6 addresses.
"""
# only initial endpoint creation requires atleast two ip addresses
# only initial endpoint creation requires at least two ip addresses
if initial:
if len(ip_addresses) < 2:
raise InvalidRequestException(
Expand Down Expand Up @@ -740,7 +740,7 @@ def create_resolver_rule(
) from exc

# The boto3 documentation indicates that ResolverEndpoint is
# optional, as does the AWS documention. But if resolver_endpoint_id
# optional, as does the AWS documentation. But if resolver_endpoint_id
# is set to None or an empty string, it results in boto3 raising
# a ParamValidationError either regarding the type or len of string.
if resolver_endpoint_id:
Expand Down
2 changes: 1 addition & 1 deletion moto/route53resolver/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def create_resolver_endpoint(self) -> str:
return json.dumps({"ResolverEndpoint": resolver_endpoint.description()})

def create_resolver_rule(self) -> str:
"""Specify which Resolver enpoint the queries will pass through."""
"""Specify which Resolver endpoint the queries will pass through."""
creator_request_id = self._get_param("CreatorRequestId")
name = self._get_param("Name")
rule_type = self._get_param("RuleType")
Expand Down
2 changes: 1 addition & 1 deletion moto/s3/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def _to_string(header: list[str] | str) -> str:
self.response_headers["Access-Control-Allow-Origin"] = origin # type: ignore
else:
raise AccessForbidden(
"CORSResponse: This CORS request is not allowed. This is usually because the evalution of Origin, request method / Access-Control-Request-Method or Access-Control-Request-Headers are not whitelisted by the resource's CORS spec."
"CORSResponse: This CORS request is not allowed. This is usually because the evaluation of Origin, request method / Access-Control-Request-Method or Access-Control-Request-Headers are not whitelisted by the resource's CORS spec."
)
if cors_rule.allowed_headers is not None:
self.response_headers["Access-Control-Allow-Headers"] = _to_string(
Expand Down
2 changes: 1 addition & 1 deletion moto/sns/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def confirm_subscription(self) -> ActionResult:

# Once Tokens are stored by the `subscribe` endpoint and distributed
# to the client somehow, then we can check validity of tokens
# presented to this method. The following code works, all thats
# presented to this method. The following code works, all that's
# needed is to perform a token check and assign that value to the
# `already_subscribed` variable.
#
Expand Down
2 changes: 1 addition & 1 deletion moto/wafv2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def make_arn(
scope = "global"
# cloudfront global scope is managed from us-east-1 region: https://docs.aws.amazon.com/waf/latest/APIReference/API_CreateIPSet.html#WAF-CreateIPSet-request-Scope
# base_backend stores global region as "aws": https://github.com/getmoto/moto/blob/d00aa025b6c3d37977508b5d5e81ecad4ca15159/moto/core/base_backend.py#L272
# Therefore needs to be overriden here to correctly form the ARN
# Therefore needs to be overridden here to correctly form the ARN
region_name = "us-east-1"

partition = get_partition(region_name)
Expand Down
4 changes: 2 additions & 2 deletions moto/workspaces/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def __init__(
),
"EnableMaintenanceMode": True,
}
# modify creation properites
# modify creation properties
self.workspace_creation_properties = workspace_creation_properties
self.ip_group_ids = "" # create_ip_group
# Default values for workspace access properties
Expand Down Expand Up @@ -515,7 +515,7 @@ 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.
# Raise Exception if Directory does not exist.
if resource_id not in self.workspace_directories:
raise ValidationException("The request is invalid.")

Expand Down
Loading