<s> from __future__ import absolute_import <EOL> import integration <EOL> import salt . auth <EOL> import salt . wheel <EOL> class WheelModuleTest ( integration . TestCase , integration . AdaptedConfigurationTestCaseMixIn ) : <EOL> eauth_creds = { <EOL> '<STR_LIT:username>' : '<STR_LIT>' , <EOL> '<STR_LIT:password>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> def setUp ( self ) : <EOL> '''<STR_LIT>''' <EOL> self . wheel = salt . wheel . Wheel ( dict ( self . get_config ( '<STR_LIT>' ) ) ) <EOL> def test_master_call ( self ) : <EOL> '''<STR_LIT>''' <EOL> low = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> low . update ( self . eauth_creds ) <EOL> self . wheel . master_call ( ** low ) <EOL> def test_token ( self ) : <EOL> '''<STR_LIT>''' <EOL> auth = salt . auth . LoadAuth ( dict ( self . get_config ( '<STR_LIT>' ) ) ) <EOL> token = auth . mk_token ( self . eauth_creds ) <EOL> token = auth . mk_token ( { <EOL> '<STR_LIT:username>' : '<STR_LIT>' , <EOL> '<STR_LIT:password>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } ) <EOL> self . wheel . master_call ( ** { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : token [ '<STR_LIT>' ] , <EOL> } ) <EOL> def test_cmd_sync ( self ) : <EOL> low = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> low . update ( self . eauth_creds ) <EOL> self . wheel . cmd_sync ( low ) <EOL> def test_cmd_async ( self ) : <EOL> low = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> low . update ( self . eauth_creds ) <EOL> self . wheel . cmd_async ( low ) <EOL> def test_cmd_sync_w_arg ( self ) : <EOL> low = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:*>' , <EOL> } <EOL> low . update ( self . eauth_creds ) <EOL> ret = self . wheel . cmd_sync ( low ) <EOL> self . assertIn ( '<STR_LIT>' , ret . get ( '<STR_LIT:data>' , { } ) ) <EOL> def test_wildcard_auth ( self ) : <EOL> low = { <EOL> '<STR_LIT:username>' : '<STR_LIT>' , <EOL> '<STR_LIT:password>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> self . wheel . cmd_sync ( low ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> from integration import run_tests <EOL> run_tests ( WheelModuleTest , needs_daemon = True ) </s>
