Skip to content

Commit

Permalink
Update test cases to use AWSCLIEntryPoint
Browse files Browse the repository at this point in the history
For v1, it only has the notion of a CLIDriver. For v2, there is
an entry point abstraction that needs to be recreated as well
as the driver to apply credential/config file changes.
  • Loading branch information
kyleknap committed May 29, 2024
1 parent 20afc51 commit 5168f56
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/functional/ssm/test_start_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import errno
import json

from awscli.clidriver import AWSCLIEntryPoint
from awscli.testutils import BaseAWSCommandParamsTest
from awscli.testutils import BaseAWSHelpOutputTest
from awscli.testutils import create_clidriver, mock, temporary_file
Expand Down Expand Up @@ -140,6 +141,7 @@ def test_profile_parameter_passed_to_sessionmanager_plugin(
expected_env.update({ssm_env_name: json.dumps(expected_response)})

self.driver = create_clidriver()
self.entry_point = AWSCLIEntryPoint(self.driver)
self.run_cmd(cmdline, expected_rc=0)

self.assertEqual(self.operations_called[0][0].name,
Expand Down Expand Up @@ -198,6 +200,7 @@ def test_profile_environment_not_passed_to_sessionmanager_plugin(
expected_env.update({ssm_env_name: json.dumps(expected_response)})

self.driver = create_clidriver()
self.entry_point = AWSCLIEntryPoint(self.driver)
self.run_cmd(cmdline, expected_rc=0)

self.assertEqual(self.operations_called[0][0].name,
Expand Down Expand Up @@ -253,6 +256,7 @@ def test_default_profile_used_and_not_passed_to_sessionmanager_plugin(
expected_env.update({ssm_env_name: json.dumps(expected_response)})

self.driver = create_clidriver()
self.entry_point = AWSCLIEntryPoint(self.driver)
self.run_cmd(cmdline, expected_rc=0)

self.assertEqual(self.operations_called[0][0].name,
Expand Down Expand Up @@ -292,6 +296,7 @@ def test_start_session_with_user_profile_not_exist(self):

try:
self.driver = create_clidriver()
self.entry_point = AWSCLIEntryPoint(self.driver)
self.run_cmd(cmdline, expected_rc=255)
except ProfileNotFound as e:
self.assertIn(
Expand Down

0 comments on commit 5168f56

Please sign in to comment.