Commit 907fe138 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Implement unit tests for kamaki.clients.astakos

Old unitests were testing the old AstakosClient class, which
is not been used anymore. The new package inctroduces wrapper
classes for the synnefo.AstakosClient class. The later is not
tested in this patch, but the wrapper classes and kamaki-specific
extentions are.
parent e1d3a85d
# Copyright 2012-2013 GRNET S.A. All rights reserved.
# Copyright 2012-2014 GRNET S.A. All rights reserved.
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
......@@ -32,6 +32,7 @@
# or implied, of GRNET S.A.
from logging import getLogger
import inspect
from astakosclient import AstakosClient as OriginalAstakosClient
from astakosclient import AstakosClientException, parse_endpoints
......@@ -83,8 +84,7 @@ class AstakosClient(OriginalAstakosClient):
# Wrap AstakosClient public methods to raise AstakosClientError
from inspect import getmembers
for m in getmembers(AstakosClient):
for m in inspect.getmembers(AstakosClient):
if hasattr(m[1], '__call__') and not ('%s' % m[0]).startswith('_'):
setattr(AstakosClient, m[0], _astakos_error(m[1]))
......@@ -131,7 +131,7 @@ class LoggedAstakosClient(AstakosClient):
data=log_response.get('data', ''))
except Exception:
recvlog.debug('Kamaki failed to log an AstakosClient call')
return r
This diff is collapsed.
......@@ -39,7 +39,8 @@ from itertools import product
from random import randint
from kamaki.clients.utils.test import Utils
from kamaki.clients.astakos.test import AstakosClient
from kamaki.clients.astakos.test import (
AstakosClient, LoggedAstakosClient, CachedAstakosClient)
from kamaki.clients.compute.test import ComputeClient, ComputeRestClient
from import (NetworkClient, NetworkRestClient)
from kamaki.clients.cyclades.test import (
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment