Skip to content

Commit

Permalink
style(tests): use updated ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
felix11h committed Jul 23, 2024
1 parent 4f6c6c1 commit 878a986
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions test_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ def test_get_region(self):

class TestApplicationVersion(TestCase):
def _get_or_create_application_version(self, polling_results: Sequence[Optional[action.ApplicationVersion]]):
with NamedTemporaryFile() as docker_compose_file, patch.object(action, "boto3"), patch.object(
action.ApplicationVersion,
"get",
side_effect=polling_results,
) as mock_get_application_version:
with (
NamedTemporaryFile() as docker_compose_file,
patch.object(action, "boto3"),
patch.object(
action.ApplicationVersion,
"get",
side_effect=polling_results,
) as mock_get_application_version,
):
result = action.get_or_create_beanstalk_application_version(
MOCK_APPLICATION,
replace(
Expand Down Expand Up @@ -87,21 +91,26 @@ def test_timeout_error(self):

class TestDeployment(TestCase):
def _deploy(self, get_health_return_values: Sequence[dict], is_active_in_environment: Sequence[bool]):
with patch.object(
action.BeanstalkEnvironment,
"get_health",
side_effect=get_health_return_values,
) as mock_get_health, patch.object(
action.BeanstalkEnvironment,
"get_events",
return_value=(),
) as mock_get_events, patch.object(
action.ApplicationVersion,
"is_active_in_environment",
side_effect=is_active_in_environment,
) as mock_is_active_in_environment, patch.object(
action,
"boto3",
with (
patch.object(
action.BeanstalkEnvironment,
"get_health",
side_effect=get_health_return_values,
) as mock_get_health,
patch.object(
action.BeanstalkEnvironment,
"get_events",
return_value=(),
) as mock_get_events,
patch.object(
action.ApplicationVersion,
"is_active_in_environment",
side_effect=is_active_in_environment,
) as mock_is_active_in_environment,
patch.object(
action,
"boto3",
),
):
iterations = len(get_health_return_values)

Expand Down

0 comments on commit 878a986

Please sign in to comment.