Revision 2af5dc96 snf-cyclades-app/synnefo/api/test/versions.py
b/snf-cyclades-app/synnefo/api/test/versions.py | ||
---|---|---|
34 | 34 |
from django.utils import simplejson as json |
35 | 35 |
from django.test import TestCase |
36 | 36 |
from snf_django.utils.testing import astakos_user |
37 |
from synnefo.cyclades_settings import cyclades_services |
|
38 |
from synnefo.lib.services import get_service_path |
|
37 | 39 |
|
38 | 40 |
class APITest(TestCase): |
39 | 41 |
def test_api_version(self): |
40 | 42 |
"""Check API version.""" |
43 |
path = get_service_path(cyclades_services, |
|
44 |
'compute', version='v2.0') |
|
41 | 45 |
with astakos_user('user'): |
42 |
response = self.client.get('/api/v1.1/')
|
|
46 |
response = self.client.get(path)
|
|
43 | 47 |
self.assertEqual(response.status_code, 200) |
44 | 48 |
api_version = json.loads(response.content)['version'] |
45 |
self.assertEqual(api_version['id'], 'v1.1')
|
|
49 |
self.assertEqual(api_version['id'], 'v2.0')
|
|
46 | 50 |
self.assertEqual(api_version['status'], 'CURRENT') |
Also available in: Unified diff