'Test deleting ec2 credential by access.'

def test_delete_ec2_keypair_access(self):

    user_id = 'atestuser'
    self._stubs_auth(user_id=user_id)
    ctx = utils.dummy_context()
    ctx.trust_id = None
    self._mock_credential_list(user_id=user_id)
    self.mock_ks_v3_client.credentials.delete('credential_id2').AndReturn(None)
    self.m.ReplayAll()
    heat_ks_client = heat_keystoneclient.KeystoneClient(ctx)
    self.assertIsNone(heat_ks_client.delete_ec2_keypair(access='access2'))
