#NEWLINE# @ patch . object ( occ . cloud_config . CloudConfig , 'get_api_version' ) #NEWLINE# @ patch . object ( OperatorCloud , 'keystone_client' ) #NEWLINE# def test_revoke_role_user_domain_exists( self , mock_keystone , mock_api_version ) : #NEWLINE# #INDENT# mock_api_version . return_value = '3' #NEWLINE# mock_keystone . users . list . return_value = [ self . fake_user ] #NEWLINE# mock_keystone . roles . list . return_value = [ self . fake_role ] #NEWLINE# mock_keystone . domains . get . return_value = self . fake_domain #NEWLINE# mock_keystone . role_assignments . list . return_value = [ self . user_domain_assignment ] #NEWLINE# self . assertTrue ( self . cloud . revoke_role ( self . fake_role [ 'name' ] , user = self . fake_user [ 'name' ] , domain = self . fake_domain [ 'name' ] ) ) #NEWLINE# self . assertTrue ( self . cloud . revoke_role ( self . fake_role [ 'name' ] , user = self . fake_user [ 'id' ] , domain = self . fake_domain [ 'name' ] ) ) #NEWLINE# self . assertTrue ( self . cloud . revoke_role ( self . fake_role [ 'name' ] , user = self . fake_user [ 'name' ] , domain = self . fake_domain [ 'id' ] ) ) #NEWLINE# self . assertTrue ( self . cloud . revoke_role ( self . fake_role [ 'name' ] , user = self . fake_user [ 'id' ] , domain = self . fake_domain [ 'id' ] ) )