'Test deleting ec2 credential by id.'

def test_delete_ec2_keypair_id(self):

    user_id = 'atestuser'
    self._stubs_auth(user_id=user_id)
    ctx = utils.dummy_context()
    ctx.trust_id = None
    credential_id = 'acredential123'
    self.mock_ks_v3_client.credentials = self.m.CreateMockAnything()
    self.mock_ks_v3_client.credentials = self.m.CreateMockAnything()
    self.mock_ks_v3_client.credentials.delete(credential_id)
    self.mock_ks_v3_client.credentials.delete(credential_id).AndRaise(kc_exception.NotFound)
    self.m.ReplayAll()
    heat_ks_client = heat_keystoneclient.KeystoneClient(ctx)
    self.assertIsNone(heat_ks_client.delete_ec2_keypair(credential_id=credential_id))
    self.assertIsNone(heat_ks_client.delete_ec2_keypair(credential_id=credential_id))
