Example #1
0
 def test_configuration_recorder_when_update_value(self):
     value = '{"name":"myname","roleARN":"myarn"}'
     parameters = {
         'ConfigurationRecorder': {
             'recordingGroup': {
                 'allSupported': True,
                 'resourceTypes': ['AWS::EC2::Volume']
             }
         }
     }
     extract_recording_group(self.session, self.argument_table)
     configuration_recorder_argument = self.argument_table[
         'configuration-recorder']
     configuration_recorder_argument.add_to_params(parameters, value)
     self.assertEqual(
         {
             'ConfigurationRecorder': {
                 'name': 'myname',
                 'roleARN': 'myarn',
                 'recordingGroup': {
                     'allSupported': True,
                     'resourceTypes': ['AWS::EC2::Volume']
                 }
             }
         }, parameters)
 def test_configuration_recorder_when_new_value(self):
     value = '{"name":"myname","roleARN":"myarn"}'
     parameters = {}
     extract_recording_group(self.session, self.argument_table)
     configuration_recorder_argument = self.argument_table[
         'configuration-recorder']
     configuration_recorder_argument.add_to_params(parameters, value)
     self.assertEqual(
         {'ConfigurationRecorder': {
             'name': 'myname',
             'roleARN': 'myarn'}},
         parameters)
 def test_recording_group_when_new_value(self):
     value = '{"allSupported":true,"resourceTypes":["AWS::EC2::Volume"]}'
     parameters = {}
     extract_recording_group(self.session, self.argument_table)
     recording_group_argument = self.argument_table['recording-group']
     recording_group_argument.add_to_params(parameters, value)
     self.assertEqual(
         {'ConfigurationRecorder': {
             'recordingGroup': {
                 'allSupported': True,
                 'resourceTypes': ['AWS::EC2::Volume']}}},
         parameters)
Example #4
0
 def test_configuration_recorder_when_new_value(self):
     value = '{"name":"myname","roleARN":"myarn"}'
     parameters = {}
     extract_recording_group(self.session, self.argument_table)
     configuration_recorder_argument = self.argument_table[
         'configuration-recorder']
     configuration_recorder_argument.add_to_params(parameters, value)
     self.assertEqual(
         {'ConfigurationRecorder': {
             'name': 'myname',
             'roleARN': 'myarn'
         }}, parameters)
Example #5
0
 def test_recording_group_when_new_value(self):
     value = '{"allSupported":true,"resourceTypes":["AWS::EC2::Volume"]}'
     parameters = {}
     extract_recording_group(self.session, self.argument_table)
     recording_group_argument = self.argument_table['recording-group']
     recording_group_argument.add_to_params(parameters, value)
     self.assertEqual(
         {
             'ConfigurationRecorder': {
                 'recordingGroup': {
                     'allSupported': True,
                     'resourceTypes': ['AWS::EC2::Volume']
                 }
             }
         }, parameters)
Example #6
0
    def test_extract_recording_group(self):
        extract_recording_group(self.session, self.argument_table)
        self.assertEqual(len(self.argument_table), 2)

        # Ensure the original argument was replaced with the updated argument.
        self.assertIn('configuration-recorder', self.argument_table)
        new_configuration_recorder_argument = self.argument_table[
            'configuration-recorder']
        self.assertIsNot(new_configuration_recorder_argument,
                         self.old_configuration_recorder_argument)
        self.assertIsInstance(new_configuration_recorder_argument,
                              ConfigurationRecorderArgument)

        # Ensure the recording group member was extracted to an argument
        self.assertIn('recording-group', self.argument_table)
        recording_group_argument = self.argument_table['recording-group']
        self.assertIsInstance(recording_group_argument, RecordingGroupArgument)
 def test_configuration_recorder_when_update_value(self):
     value = '{"name":"myname","roleARN":"myarn"}'
     parameters = {
         'ConfigurationRecorder': {
             'recordingGroup': {
                 'allSupported': True,
                 'resourceTypes': ['AWS::EC2::Volume']
             }
         }
     }
     extract_recording_group(self.session, self.argument_table)
     configuration_recorder_argument = self.argument_table[
         'configuration-recorder']
     configuration_recorder_argument.add_to_params(parameters, value)
     self.assertEqual(
         {'ConfigurationRecorder': {
             'name': 'myname',
             'roleARN': 'myarn',
             'recordingGroup': {
                 'allSupported': True,
                 'resourceTypes': ['AWS::EC2::Volume']}}},
         parameters)
    def test_extract_recording_group(self):
        extract_recording_group(self.session, self.argument_table)
        self.assertEqual(len(self.argument_table), 2)

        # Ensure the original argument was replaced with the updated argument.
        self.assertIn('configuration-recorder', self.argument_table)
        new_configuration_recorder_argument = self.argument_table[
            'configuration-recorder']
        self.assertIsNot(
            new_configuration_recorder_argument,
            self.old_configuration_recorder_argument
        )
        self.assertIsInstance(
            new_configuration_recorder_argument,
            ConfigurationRecorderArgument
        )

        # Ensure the recording group member was extracted to an argument
        self.assertIn('recording-group', self.argument_table)
        recording_group_argument = self.argument_table['recording-group']
        self.assertIsInstance(
            recording_group_argument,
            RecordingGroupArgument
        )