Skip to content

Commit

Permalink
refactor config tests to be in CI and use run_cmd instead of aws (#…
Browse files Browse the repository at this point in the history
…7211)

* refactor config tests to be in CI and use `run_cmd` instead of `aws`

Moving to functional suite so that they run in GitHub CI. They can be
moved because no actual HTTP requests are made using the `configure`
command. These tests either silently failed or weren't run at all in a
release that allowed a bug to be introduced to customers using the
latest version of v1.
  • Loading branch information
dlm6693 authored Aug 25, 2022
1 parent ab1ca45 commit d2d7dff
Show file tree
Hide file tree
Showing 5 changed files with 392 additions and 350 deletions.
6 changes: 5 additions & 1 deletion awscli/customizations/configure/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ class ConfigureGetCommand(BasicCommand):
'cli_type_name': 'string', 'positional_arg': True},
]

def __init__(self, session, stream=sys.stdout, error_stream=sys.stderr):
def __init__(self, session, stream=None, error_stream=None):
super(ConfigureGetCommand, self).__init__(session)
if stream is None:
stream = sys.stdout
if error_stream is None:
error_stream = sys.stderr
self._stream = stream
self._error_stream = error_stream

Expand Down
5 changes: 4 additions & 1 deletion awscli/customizations/configure/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ class ConfigureListCommand(BasicCommand):
'\n'
)

def __init__(self, session, stream=sys.stdout):
def __init__(self, session, stream=None):
super(ConfigureListCommand, self).__init__(session)
if stream is None:
stream = sys.stdout
self._stream = stream

def _run_main(self, args, parsed_globals):
Expand All @@ -66,6 +68,7 @@ def _run_main(self, args, parsed_globals):

region = self._lookup_config('region')
self._display_config_value(region, 'region')
return 0

def _display_config_value(self, config_value, config_name):
self._stream.write('%10s %24s %16s %s\n' % (
Expand Down
1 change: 1 addition & 0 deletions awscli/customizations/configure/set.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ def _run_main(self, args, parsed_globals):
section = profile_to_section(profile)
updated_config = {'__section__': section, varname: value}
self._config_writer.update_config(updated_config, config_filename)
return 0
Loading

0 comments on commit d2d7dff

Please sign in to comment.