Skip to content

Commit

Permalink
Fix test method signatures
Browse files Browse the repository at this point in the history
These static testing method names were mixed up by the
refactor. They are intended to be called outside of the file,
and so they should not be prefixed with a _ according to the
ruff linter
  • Loading branch information
landonshumway-ia committed Oct 18, 2024
1 parent bd62c3e commit 5886d78
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions backend/compact-connect/tests/unit/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_no_compact_jurisdiction_name_clash(self):
self.assertFalse(jurisdictions.intersection(compacts), 'Compact vs jurisdiction name clash!')

@staticmethod
def _get_resource_properties_by_logical_id(logical_id: str, resources: Mapping[str, Mapping]) -> Mapping:
def get_resource_properties_by_logical_id(logical_id: str, resources: Mapping[str, Mapping]) -> Mapping:
"""
Helper function to retrieve a resource from a CloudFormation template by its logical ID.
"""
Expand Down Expand Up @@ -87,7 +87,7 @@ def _inspect_persistent_stack(
persistent_stack_template.resource_count_is(CfnUserPool.CFN_RESOURCE_TYPE_NAME, 2)

# Ensure our provider user pool is created with expected custom attributes
provider_users_user_pool = self._get_resource_properties_by_logical_id(
provider_users_user_pool = self.get_resource_properties_by_logical_id(
persistent_stack.get_logical_id(persistent_stack.provider_users.node.default_child),
persistent_stack_template.find_resources(CfnUserPool.CFN_RESOURCE_TYPE_NAME),
)
Expand All @@ -101,7 +101,7 @@ def _inspect_persistent_stack(
{'AttributeDataType': 'String', 'Mutable': False, 'Name': 'compact'}, provider_users_user_pool['Schema']
)
# Ensure our Staff user pool app client is configured with the expected callbacks and read/write attributes
staff_users_user_pool_app_client = self._get_resource_properties_by_logical_id(
staff_users_user_pool_app_client = self.get_resource_properties_by_logical_id(
persistent_stack.get_logical_id(persistent_stack.staff_users.ui_client.node.default_child),
persistent_stack_template.find_resources(CfnUserPoolClient.CFN_RESOURCE_TYPE_NAME),
)
Expand All @@ -110,7 +110,7 @@ def _inspect_persistent_stack(
self.assertEqual(staff_users_user_pool_app_client['WriteAttributes'], ['email'])

# Ensure our Provider user pool app client is created with expected values
provider_users_user_pool_app_client = self._get_resource_properties_by_logical_id(
provider_users_user_pool_app_client = self.get_resource_properties_by_logical_id(
persistent_stack.get_logical_id(persistent_stack.provider_users.ui_client.node.default_child),
persistent_stack_template.find_resources(CfnUserPoolClient.CFN_RESOURCE_TYPE_NAME),
)
Expand Down
2 changes: 1 addition & 1 deletion backend/compact-connect/tests/unit/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_context(cls):
return context

@staticmethod
def _generate_expected_integration_object(handler_logical_id: str) -> dict:
def generate_expected_integration_object(handler_logical_id: str) -> dict:
return {
'Uri': {
'Fn::Join': [
Expand Down
2 changes: 1 addition & 1 deletion backend/compact-connect/tests/unit/test_app_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_synth_generates_compact_configuration_upload_custom_resource_with_expec
persistent_stack_template = Template.from_stack(persistent_stack)

# Ensure our provider user pool is created with expected custom attributes
compact_configuration_uploader_custom_resource = self._get_resource_properties_by_logical_id(
compact_configuration_uploader_custom_resource = self.get_resource_properties_by_logical_id(
persistent_stack.get_logical_id(
persistent_stack.compact_configuration_upload.compact_configuration_uploader_custom_resource.node.default_child
),
Expand Down

0 comments on commit 5886d78

Please sign in to comment.