<s> from awscli . testutils import BaseAWSCommandParamsTest <EOL> class TestModifyInstanceAttribute ( BaseAWSCommandParamsTest ) : <EOL> prefix = '<STR_LIT>' <EOL> def setUp ( self ) : <EOL> super ( TestModifyInstanceAttribute , self ) . setUp ( ) <EOL> self . expected_result = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { '<STR_LIT>' : '<STR_LIT>' } <EOL> } <EOL> def test_json_version ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> self . assert_params_for_cmd ( cmdline , self . expected_result ) <EOL> def test_shorthand_version ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> self . assert_params_for_cmd ( cmdline , self . expected_result ) <EOL> def test_value_not_needed ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> self . assert_params_for_cmd ( cmdline , self . expected_result ) <EOL> def test_boolean_value_in_top_level_true ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> result = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { '<STR_LIT>' : True } } <EOL> self . assert_params_for_cmd ( cmdline , result ) <EOL> def test_boolean_value_is_top_level_false ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> result = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { '<STR_LIT>' : False } } <EOL> self . assert_params_for_cmd ( cmdline , result ) <EOL> def test_boolean_value_in_top_level_true_json ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> result = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { '<STR_LIT>' : True } } <EOL> self . assert_params_for_cmd ( cmdline , result ) <EOL> def test_boolean_value_is_top_level_false_json ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> result = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { '<STR_LIT>' : False } } <EOL> self . assert_params_for_cmd ( cmdline , result ) <EOL> def test_boolean_param_top_level_true_no_value ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> result = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { '<STR_LIT>' : True } } <EOL> self . assert_params_for_cmd ( cmdline , result ) <EOL> def test_boolean_param_top_level_false_no_value ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> result = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { '<STR_LIT>' : False } } <EOL> self . assert_params_for_cmd ( cmdline , result ) <EOL> def test_mix_value_non_value_boolean_param ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> self . assert_params_for_cmd ( cmdline , expected_rc = <NUM_LIT:255> , <EOL> stderr_contains = '<STR_LIT>' ) <EOL> def test_mix_non_value_bools_not_allowed ( self ) : <EOL> cmdline = self . prefix <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> cmdline += '<STR_LIT>' <EOL> self . assert_params_for_cmd ( cmdline , expected_rc = <NUM_LIT:255> , <EOL> stderr_contains = '<STR_LIT>' ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
