<s> import unittest2 <EOL> from st2common . models . system . paramiko_command_action import ParamikoRemoteCommandAction <EOL> class ParamikoRemoteComamndActionTests ( unittest2 . TestCase ) : <EOL> def test_get_command_string_no_env_vars ( self ) : <EOL> cmd_action = ParamikoRemoteComamndActionTests . _get_test_command_action ( '<STR_LIT>' ) <EOL> ex = '<STR_LIT>' <EOL> self . assertEqual ( cmd_action . get_full_command_string ( ) , ex ) <EOL> cmd_action . sudo = True <EOL> ex = '<STR_LIT>' <EOL> self . assertEqual ( cmd_action . get_full_command_string ( ) , ex ) <EOL> cmd_action = ParamikoRemoteComamndActionTests . _get_test_command_action ( <EOL> '<STR_LIT>' ) <EOL> ex = '<STR_LIT>' <EOL> self . assertEqual ( cmd_action . get_full_command_string ( ) , ex ) <EOL> def test_get_command_string_with_env_vars ( self ) : <EOL> cmd_action = ParamikoRemoteComamndActionTests . _get_test_command_action ( '<STR_LIT>' ) <EOL> cmd_action . env_vars = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ex = '<STR_LIT>' + '<STR_LIT>' + '<STR_LIT>' <EOL> self . assertEqual ( cmd_action . get_full_command_string ( ) , ex ) <EOL> cmd_action . sudo = True <EOL> ex = '<STR_LIT>' + '<STR_LIT>' + '<STR_LIT>' + '<STR_LIT>' <EOL> self . assertEqual ( cmd_action . get_full_command_string ( ) , ex ) <EOL> def test_get_command_string_no_user ( self ) : <EOL> cmd_action = ParamikoRemoteComamndActionTests . _get_test_command_action ( '<STR_LIT>' ) <EOL> cmd_action . user = None <EOL> ex = '<STR_LIT>' <EOL> self . assertEqual ( cmd_action . get_full_command_string ( ) , ex ) <EOL> cmd = '<STR_LIT>' <EOL> cmd_action = ParamikoRemoteComamndActionTests . _get_test_command_action ( cmd ) <EOL> cmd_action . user = None <EOL> ex = '<STR_LIT>' <EOL> self . assertEqual ( cmd_action . get_full_command_string ( ) , ex ) <EOL> def test_get_command_string_no_user_env_vars ( self ) : <EOL> cmd_action = ParamikoRemoteComamndActionTests . _get_test_command_action ( '<STR_LIT>' ) <EOL> cmd_action . user = None <EOL> cmd_action . env_vars = { '<STR_LIT>' : '<STR_LIT>' } <EOL> ex = '<STR_LIT>' <EOL> self . assertEqual ( cmd_action . get_full_command_string ( ) , ex ) <EOL> @ staticmethod <EOL> def _get_test_command_action ( command ) : <EOL> cmd_action = ParamikoRemoteCommandAction ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> command = command , <EOL> env_vars = { } , <EOL> on_behalf_user = '<STR_LIT>' , <EOL> user = '<STR_LIT>' , <EOL> password = None , <EOL> private_key = '<STR_LIT>' , <EOL> hosts = '<STR_LIT:127.0.0.1>' , <EOL> parallel = True , <EOL> sudo = False , <EOL> timeout = None , <EOL> cwd = '<STR_LIT>' ) <EOL> return cmd_action </s>
