#NEWLINE# @ mock . patch . object ( seamicro_client , 'Client' , autospec = True ) #NEWLINE# def test__get_client_fail( self , mock_client ) : #NEWLINE# #INDENT# args = { #NEWLINE# #INDENT# 'username' : self . info [ 'username' ] , #NEWLINE# 'password' : self . info [ 'password' ] , #NEWLINE# 'auth_url' : self . info [ 'api_endpoint' ] , #NEWLINE# #UNINDENT# } #NEWLINE# mock_client . side_effect = seamicro_client_exception . UnsupportedVersion #NEWLINE# self . assertRaises ( exception . InvalidParameterValue , seamicro . _get_client , ** args . info ) #NEWLINE# mock_client . assert_called_once_with ( self . info [ 'api_version' ] , ** args )