<s> import mock <EOL> from tests . unit . customizations . emr import EMRBaseAWSCommandParamsTest as BaseAWSCommandParamsTest <EOL> from copy import deepcopy <EOL> class TestDisableHBaseBackups ( BaseAWSCommandParamsTest ) : <EOL> prefix = '<STR_LIT>' <EOL> DISABLE_FULL_BACKUP = '<STR_LIT>' <EOL> DISABLE_INCR_BACKUP = '<STR_LIT>' <EOL> default_steps = [ { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT:false>' <EOL> ] , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> '<STR_LIT:Name>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } ] <EOL> def test_disable_hbase_backups_full ( self ) : <EOL> args = '<STR_LIT>' <EOL> cmdline = self . prefix + args <EOL> steps = deepcopy ( self . default_steps ) <EOL> steps [ <NUM_LIT:0> ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( self . DISABLE_FULL_BACKUP ) <EOL> result = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : steps } <EOL> self . assert_params_for_cmd ( cmdline , result ) <EOL> def test_disable_hbase_backups_incremental ( self ) : <EOL> args = '<STR_LIT>' <EOL> cmdline = self . prefix + args <EOL> steps = deepcopy ( self . default_steps ) <EOL> steps [ <NUM_LIT:0> ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( self . DISABLE_INCR_BACKUP ) <EOL> result = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : steps } <EOL> self . assert_params_for_cmd ( cmdline , result ) <EOL> def test_disable_hbase_backups_both ( self ) : <EOL> args = '<STR_LIT>' <EOL> cmdline = self . prefix + args <EOL> steps = deepcopy ( self . default_steps ) <EOL> steps [ <NUM_LIT:0> ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( self . DISABLE_FULL_BACKUP ) <EOL> steps [ <NUM_LIT:0> ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( self . DISABLE_INCR_BACKUP ) <EOL> result = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : steps } <EOL> self . assert_params_for_cmd ( cmdline , result ) <EOL> def test_disable_hbase_backups_none ( self ) : <EOL> args = '<STR_LIT>' <EOL> cmdline = self . prefix + args <EOL> expected_error_msg = '<STR_LIT>' + '<STR_LIT>' <EOL> result = self . run_cmd ( cmdline , <NUM_LIT:255> ) <EOL> self . assertEquals ( expected_error_msg , result [ <NUM_LIT:1> ] ) <EOL> @ mock . patch ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> def test_unsupported_command_on_release_based_cluster_error ( <EOL> self , grl_patch ) : <EOL> grl_patch . return_value = '<STR_LIT>' <EOL> args = '<STR_LIT>' <EOL> cmdline = self . prefix + args <EOL> expected_error_msg = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> result = self . run_cmd ( cmdline , <NUM_LIT:255> ) <EOL> self . assertEqual ( result [ <NUM_LIT:1> ] , expected_error_msg ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
