root / kamaki / clients / tests / astakos.py @ 6d192774
History | View | Annotate | Download (2.2 kB)
1 | 6d192774 | Stavros Sachtouris | # Copyright 2012-2013 GRNET S.A. All rights reserved.
|
---|---|---|---|
2 | 6d192774 | Stavros Sachtouris | #
|
3 | 6d192774 | Stavros Sachtouris | # Redistribution and use in source and binary forms, with or
|
4 | 6d192774 | Stavros Sachtouris | # without modification, are permitted provided that the following
|
5 | 6d192774 | Stavros Sachtouris | # conditions are met:
|
6 | 6d192774 | Stavros Sachtouris | #
|
7 | 6d192774 | Stavros Sachtouris | # 1. Redistributions of source code must retain the above
|
8 | 6d192774 | Stavros Sachtouris | # copyright notice, this list of conditions and the following
|
9 | 6d192774 | Stavros Sachtouris | # disclaimer.
|
10 | 6d192774 | Stavros Sachtouris | #
|
11 | 6d192774 | Stavros Sachtouris | # 2. Redistributions in binary form must reproduce the above
|
12 | 6d192774 | Stavros Sachtouris | # copyright notice, this list of conditions and the following
|
13 | 6d192774 | Stavros Sachtouris | # disclaimer in the documentation and/or other materials
|
14 | 6d192774 | Stavros Sachtouris | # provided with the distribution.
|
15 | 6d192774 | Stavros Sachtouris | #
|
16 | 6d192774 | Stavros Sachtouris | # THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
|
17 | 6d192774 | Stavros Sachtouris | # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
18 | 6d192774 | Stavros Sachtouris | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
19 | 6d192774 | Stavros Sachtouris | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
|
20 | 6d192774 | Stavros Sachtouris | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21 | 6d192774 | Stavros Sachtouris | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22 | 6d192774 | Stavros Sachtouris | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
23 | 6d192774 | Stavros Sachtouris | # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
24 | 6d192774 | Stavros Sachtouris | # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
25 | 6d192774 | Stavros Sachtouris | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
26 | 6d192774 | Stavros Sachtouris | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
27 | 6d192774 | Stavros Sachtouris | # POSSIBILITY OF SUCH DAMAGE.
|
28 | 6d192774 | Stavros Sachtouris | #
|
29 | 6d192774 | Stavros Sachtouris | # The views and conclusions contained in the software and
|
30 | 6d192774 | Stavros Sachtouris | # documentation are those of the authors and should not be
|
31 | 6d192774 | Stavros Sachtouris | # interpreted as representing official policies, either expressed
|
32 | 6d192774 | Stavros Sachtouris | # or implied, of GRNET S.A.
|
33 | 6d192774 | Stavros Sachtouris | |
34 | 6d192774 | Stavros Sachtouris | from unittest import TestCase |
35 | 6d192774 | Stavros Sachtouris | |
36 | 6d192774 | Stavros Sachtouris | from kamaki.clients.tests import configuration |
37 | 6d192774 | Stavros Sachtouris | from kamaki.clients.astakos import AstakosClient as astakos |
38 | 6d192774 | Stavros Sachtouris | |
39 | 6d192774 | Stavros Sachtouris | |
40 | 6d192774 | Stavros Sachtouris | class testAstakos(TestCase): |
41 | 6d192774 | Stavros Sachtouris | def setUp(self): |
42 | 6d192774 | Stavros Sachtouris | self.cnf = configuration('astakos') |
43 | 6d192774 | Stavros Sachtouris | self.client = astakos(self.cnf.url, self.cnf.token) |
44 | 6d192774 | Stavros Sachtouris | |
45 | 6d192774 | Stavros Sachtouris | def tearDown(self): |
46 | 6d192774 | Stavros Sachtouris | pass
|
47 | 6d192774 | Stavros Sachtouris | |
48 | 6d192774 | Stavros Sachtouris | def test_authenticate(self): |
49 | 6d192774 | Stavros Sachtouris | r = self.client.authenticate()
|
50 | 6d192774 | Stavros Sachtouris | for term in ('username', |
51 | 6d192774 | Stavros Sachtouris | 'auth_token_expires',
|
52 | 6d192774 | Stavros Sachtouris | 'auth_token',
|
53 | 6d192774 | Stavros Sachtouris | 'auth_token_created',
|
54 | 6d192774 | Stavros Sachtouris | 'groups',
|
55 | 6d192774 | Stavros Sachtouris | 'uniq',
|
56 | 6d192774 | Stavros Sachtouris | 'has_credits',
|
57 | 6d192774 | Stavros Sachtouris | 'has_signed_terms'):
|
58 | 6d192774 | Stavros Sachtouris | self.assertTrue(term in r) |