Commit c7af1b36 authored by Georgios D. Tsoukalas's avatar Georgios D. Tsoukalas
Browse files

astakos: test 400 on wrong astakos API paths

parent a04e5fd0
......@@ -32,6 +32,9 @@
# or implied, of GRNET S.A.
from astakos.im.tests.common import *
from astakos.im.settings import astakos_services, BASE_HOST
from synnefo.lib.services import get_service_path
from synnefo.lib import join_urls
from django.test import TestCase
from django.core.urlresolvers import reverse
......@@ -590,3 +593,25 @@ class TokensApiTest(TestCase):
# body = minidom.parseString(r.content)
# except Exception, e:
# self.fail(e)
class WrongPathAPITest(TestCase):
def test_catch_wrong_api_paths(self, *args):
path = get_service_path(astakos_services, 'account', 'v1.0')
path = join_urls(BASE_HOST, path, 'nonexistent')
response = self.client.get(path)
self.assertEqual(response.status_code, 400)
try:
error = json.loads(response.content)
except ValueError:
self.assertTrue(False)
def test_catch_wrong_api_paths(self, *args):
path = get_service_path(astakos_services, 'identity', 'v2.0')
path = join_urls(BASE_HOST, path, 'nonexistent')
response = self.client.get(path)
self.assertEqual(response.status_code, 400)
try:
error = json.loads(response.content)
except ValueError:
self.assertTrue(False)
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