Example #1
0
 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')
Example #2
0
 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')
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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')
Example #6
0
 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')
Example #7
0
 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')