Skip to content

Commit

Permalink
more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kukushking committed Dec 9, 2024
1 parent 7e2586e commit f8ee029
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 4 additions & 1 deletion test/unit-test/mock_data/mock_deployment_manifest_huge.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,10 @@
"alias": "primary",
"account_id": "123456789012",
"default": True,
"parameters_global": {"dockerCredentialsSecret": "aws-addf-docker-credentials"},
"parameters_global": {
"dockerCredentialsSecret": "aws-addf-docker-credentials",
"permissionsBoundaryName": "boundary",
},
"region_mappings": [
{
"region": "us-east-1",
Expand Down
13 changes: 12 additions & 1 deletion test/unit-test/test_commands_deployment.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import os
from unittest.mock import ANY

import mock_data.mock_deployment_manifest_for_destroy as mock_deployment_manifest_for_destroy
import mock_data.mock_deployment_manifest_huge as mock_deployment_manifest_huge
Expand Down Expand Up @@ -293,7 +294,9 @@ def test_create_module_deployment_role(session_manager, mocker):
"seedfarmer.commands._deployment_commands.get_generic_module_deployment_role_name",
return_value="generic-module-deployment-role",
)
mocker.patch("seedfarmer.commands._deployment_commands.create_module_deployment_role", return_value=None)
mock_create_module_deployment_role = mocker.patch(
"seedfarmer.commands._deployment_commands.create_module_deployment_role", return_value=None
)

dep = DeploymentManifest(**mock_deployment_manifest_huge.deployment_manifest)
dep.validate_and_set_module_defaults()
Expand All @@ -304,6 +307,14 @@ def test_create_module_deployment_role(session_manager, mocker):
deployment_manifest=dep,
)

mock_create_module_deployment_role.assert_called_once_with(
role_name="generic-module-deployment-role",
deployment_name="mlops",
permissions_boundary_arn="arn:aws:iam::123456789012:policy/boundary",
docker_credentials_secret=None,
session=ANY,
)


@pytest.mark.commands
@pytest.mark.commands_deployment
Expand Down

0 comments on commit f8ee029

Please sign in to comment.