Path: blob/develop/tests/functional/rds/test_modify_option_group.py
1567 views
#!/usr/bin/env python1# Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.2#3# Licensed under the Apache License, Version 2.0 (the "License"). You4# may not use this file except in compliance with the License. A copy of5# the License is located at6#7# http://aws.amazon.com/apache2.0/8#9# or in the "license" file accompanying this file. This file is10# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF11# ANY KIND, either express or implied. See the License for the specific12# language governing permissions and limitations under the License.13from awscli.testutils import BaseAWSCommandParamsTest141516class TestAddOptionGroup(BaseAWSCommandParamsTest):17maxDiff = None18# This tests the customization where modify-option-group19# was split into two commands add-option-group and20# remove-option-group. This class is testing add-option-gruop2122prefix = 'rds add-option-to-option-group '2324def test_add_option(self):25args = ('--option-group-name myoptiongroup2 '26'--options {"OptionName":"TDE"}')27cmdline = self.prefix + args28result = {'OptionsToInclude': [{'OptionName': 'TDE'}],29'OptionGroupName': 'myoptiongroup2'}30self.assert_params_for_cmd(cmdline, result)3132def test_option_to_remove_is_not_allowed(self):33args = ('--option-group-name myoptiongroup2 '34'--options-to-remove foo')35cmdline = self.prefix + args36self.assert_params_for_cmd(37cmdline, expected_rc=255,38stderr_contains='Unknown options: --options-to-remove')394041class TestRemoveOptionGroup(BaseAWSCommandParamsTest):4243prefix = 'rds remove-option-from-option-group '4445def test_remove_options(self):46args = ('--option-group-name myoptiongroup2 '47'--options TDE')48cmdline = self.prefix + args49result = {'OptionsToRemove': ['TDE'],50'OptionGroupName': 'myoptiongroup2'}51self.assert_params_for_cmd(cmdline, result)5253def test_option_to_add_is_not_allowed(self):54args = ('--option-group-name myoptiongroup2 '55'--options-to-include {"OptionName":"TDE"}')56cmdline = self.prefix + args57self.assert_params_for_cmd(58cmdline, expected_rc=255,59stderr_contains='Unknown options: --options-to-include')606162