Skip to content
Permalink
Browse files
Test api discovery
  • Loading branch information
brogand93 committed May 31, 2014
1 parent 1a5ee54 commit 255f057975b09d0a16f1fa38d8aa75988e688ee7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
@@ -28,8 +28,7 @@ def discovery():
with open(app.config['DATA'] + '/v1.json') as template:
discovery_template = json.loads(template.read())

discovery_template[
'baseUrl'] = helper.get_root_url() + '/' + app.config['PATH']
discovery_template['baseUrl'] = helper.get_root_url() + '/' + app.config['PATH']
discovery_template['basePath'] = '/' + app.config['PATH']
discovery_template['rootUrl'] = helper.get_root_url() + '/'
discovery_template['servicePath'] = app.config['PATH']
@@ -0,0 +1,11 @@
#!/usr/bin/env python
# encoding: utf-8

from . import GStackAppTestCase

class DiscoveryTestCase(GStackAppTestCase):

def test_discovery(self):
response = self.get('/discovery/v1/apis/compute/v1/rest')

self.assert_ok(response)
@@ -1,3 +1,4 @@
PATH = 'compute/v1/projects/'
GSTACK_BIND_ADDRESS = 'localhost'
GSTACK_PORT = '5000'
CLOUDSTACK_HOST = 'api.exoscale.ch'
@@ -19,6 +19,9 @@ def post(self, *args, **kwargs):
self._request(self.client.post, *args, **self._html_data(kwargs))
)

def get(self, *args, **kwargs):
return self._request(self.client.get, *args, **kwargs)

def assert_status_code(self, response, status_code):
self.assertEquals(status_code, response.status_code)
return response

0 comments on commit 255f057

Please sign in to comment.