Revision b9d07587 kamaki/clients/tests.py
b/kamaki/clients/tests.py | ||
---|---|---|
43 | 43 |
from kamaki.clients import ClientError |
44 | 44 |
from kamaki.clients.pithos import PithosClient as pithos |
45 | 45 |
from kamaki.clients.cyclades import CycladesClient as cyclades |
46 |
from kamaki.clients.image import ImageClient as image |
|
47 |
from kamaki.clients.astakos import AstakosClient as astakos |
|
46 | 48 |
|
47 | 49 |
TEST_ALL = False |
48 | 50 |
|
51 |
class testAstakos(unittest.TestCase): |
|
52 |
def setUp(self): |
|
53 |
url='https://accounts.okeanos.grnet.gr' |
|
54 |
token = 'Kn+G9dfmlPLR2WFnhfBOow==' |
|
55 |
self.client = astakos(url, token) |
|
56 |
def tearDown(self): |
|
57 |
pass |
|
58 |
def test_authenticate(self): |
|
59 |
r = self.client.authenticate() |
|
60 |
for term in ('username', |
|
61 |
'auth_token_expires', |
|
62 |
'auth_token', |
|
63 |
'auth_token_created', |
|
64 |
'groups', |
|
65 |
'uniq', |
|
66 |
'has_credits', |
|
67 |
'has_signed_terms'): |
|
68 |
self.assertTrue(r.has_key(term)) |
|
69 |
|
|
70 |
class testImage(unittest.TestCase): |
|
71 |
def setUp(self): |
|
72 |
url = 'https://plankton.okeanos.grnet.gr' |
|
73 |
token = 'Kn+G9dfmlPLR2WFnhfBOow==' |
|
74 |
self.client = image(url, token) |
|
75 |
|
|
76 |
def tearDown(self): |
|
77 |
pass |
|
78 |
|
|
79 |
def test_list_public(self): |
|
80 |
r = self.client.list_public() |
|
81 |
print(r) |
|
82 |
|
|
49 | 83 |
class testCyclades(unittest.TestCase): |
50 | 84 |
"""Set up a Cyclades thorough test""" |
51 | 85 |
def setUp(self): |
... | ... | |
1935 | 1969 |
suiteFew.addTest(testCyclades('test_000')) |
1936 | 1970 |
else: |
1937 | 1971 |
suiteFew.addTest(testCyclades('test_'+argv[1])) |
1972 |
if len(argv) == 0 or argv[0] == 'image': |
|
1973 |
if len(argv) == 1: |
|
1974 |
suiteFew.addTest(unittest.makeSuite(testImage)) |
|
1975 |
else: |
|
1976 |
suiteFew.addTest(testImage('test'+argv[1])) |
|
1977 |
if len(argv) == 0 or argv[0] == 'astakos': |
|
1978 |
if len(argv) == 1: |
|
1979 |
suiteFew.addTest(unittest.makeSuite(testAstakos)) |
|
1980 |
else: |
|
1981 |
suiteFew.addTest(testAstakos('test'+argv[1])) |
|
1938 | 1982 |
|
1939 | 1983 |
unittest.TextTestRunner(verbosity = 2).run(suiteFew) |
Also available in: Unified diff