#NEWLINE# @ patch . object ( occ . cloud_config . CloudConfig , 'get_api_version' ) #NEWLINE# @ patch . object ( OperatorCloud , 'keystone_client' ) #NEWLINE# def test_grant_role_group_project( self , mock_keystone , mock_api_version ) : #NEWLINE# #INDENT# mock_api_version . return_value = '3' #NEWLINE# mock_keystone . roles . list . return_value = [ self . fake_role ] #NEWLINE# mock_keystone . projects . list . return_value = [ self . fake_project ] #NEWLINE# mock_keystone . groups . list . return_value = [ self . fake_group ] #NEWLINE# mock_keystone . role_assignments . list . return_value = [ ] #NEWLINE# self . assertTrue ( self . cloud . grant_role ( self . fake_role [ 'name' ] , group = self . fake_group [ 'name' ] , project = self . fake_project [ 'id' ] ) ) #NEWLINE# self . assertTrue ( self . cloud . grant_role ( self . fake_role [ 'name' ] , group = self . fake_group [ 'id' ] , project = self . fake_project [ 'id' ] ) )