def test_configure_set_command_dotted(self): set_command = ConfigureSetCommand(self.config_writer) set_command(self.context, args=['preview.foo', 'true'], parsed_globals=None) self.config_writer.update_config.assert_called_with( { '__section__': 'preview', 'foo': 'true' }, 'myconfigfile')
def test_configure_set_command(self): set_command = ConfigureSetCommand(self.config_writer) set_command(self.context, args=['region', 'us-west-2'], parsed_globals=None) self.config_writer.update_config.assert_called_with( { '__section__': 'default', 'region': 'us-west-2' }, 'myconfigfile')
def test_access_key_written_to_shared_credentials_file_profile(self): set_command = ConfigureSetCommand(self.config_writer) set_command(self.context, args=['profile.foo.cdp_access_key_id', 'bar'], parsed_globals=None) self.config_writer.update_config.assert_called_with( { '__section__': 'foo', CDP_ACCESS_KEY_ID_KEY_NAME: 'bar' }, self.fake_credentials_filename)
def test_private_key_written_to_shared_credentials_file(self): set_command = ConfigureSetCommand(self.config_writer) set_command(self.context, args=[CDP_PRIVATE_KEY_KEY_NAME, 'foo'], parsed_globals=None) self.config_writer.update_config.assert_called_with( { '__section__': 'default', CDP_PRIVATE_KEY_KEY_NAME: 'foo' }, self.fake_credentials_filename)
def test_configure_set_triple_dotted(self): # cdp configure set default.s3.signature_version s3v4 set_command = ConfigureSetCommand(self.config_writer) set_command(self.context, args=['default.s3.signature_version', 's3v4'], parsed_globals=None) self.config_writer.update_config.assert_called_with( { '__section__': 'default', 's3': { 'signature_version': 's3v4' } }, 'myconfigfile')
def test_configure_set_command_dotted_with_profile(self): self.context.profile = 'thu-dev' set_command = ConfigureSetCommand(self.config_writer) set_command(self.context, args=['thu.instance_profile', 'my_ip_thu'], parsed_globals=None) self.config_writer.update_config.assert_called_with( { '__section__': 'profile thu-dev', 'thu': { 'instance_profile': 'my_ip_thu' } }, 'myconfigfile')
def test_configure_set_command_dotted_with_default_profile(self): self.context.variables['profile'] = 'default' set_command = ConfigureSetCommand(self.config_writer) set_command(self.context, args=['foo.instance_profile', 'my_ip_foo'], parsed_globals=None) self.config_writer.update_config.assert_called_with( { '__section__': 'default', 'foo': { 'instance_profile': 'my_ip_foo' } }, 'myconfigfile')