Revision a3accf03 snf-cyclades-app/synnefo/api/test/versions.py
b/snf-cyclades-app/synnefo/api/test/versions.py | ||
---|---|---|
36 | 36 |
from snf_django.utils.testing import astakos_user |
37 | 37 |
from synnefo.cyclades_settings import cyclades_services |
38 | 38 |
from synnefo.lib.services import get_service_path |
39 |
from synnefo.lib import join_urls |
|
40 |
|
|
39 | 41 |
|
40 | 42 |
class APITest(TestCase): |
41 | 43 |
def test_api_version(self): |
... | ... | |
48 | 50 |
api_version = json.loads(response.content)['version'] |
49 | 51 |
self.assertEqual(api_version['id'], 'v2.0') |
50 | 52 |
self.assertEqual(api_version['status'], 'CURRENT') |
53 |
|
|
54 |
def test_catch_wrong_api_paths(self, *args): |
|
55 |
path = get_service_path(cyclades_services, |
|
56 |
'compute', version='v2.0') |
|
57 |
response = self.client.get(join_urls(path, 'nonexistent')) |
|
58 |
self.assertEqual(response.status_code, 400) |
|
59 |
try: |
|
60 |
error = json.loads(response.content) |
|
61 |
except ValueError: |
|
62 |
self.assertTrue(False) |
Also available in: Unified diff