Permalink
Browse files

Self describe api type in status route

  • Loading branch information...
pwnbus committed Jun 14, 2018
1 parent 5f83f13 commit 1067ad01b2c8018e3efd9dc07adf9ad4a7a3c81f
View
No changes.
View
@@ -23,7 +23,7 @@ def status():
request.body.close()
response.status = 200
response.content_type = "application/json"
response.body = json.dumps(dict(status='ok'))
response.body = json.dumps(dict(status='ok', service='loginput'))
return response
@route('/test')
View
No changes.
View
@@ -68,7 +68,7 @@ def status():
request.body.close()
response.status = 200
response.content_type = "application/json"
response.body = json.dumps(dict(status='ok'))
response.body = json.dumps(dict(status='ok', service='restapi'))
sendMessgeToPlugins(request, response, 'status')
return response
@@ -14,13 +14,12 @@
sample_config.configfile = os.path.join(os.path.dirname(__file__), '../../loginput/index.conf')
OptionParser.parse_args = mock.Mock(return_value=(sample_config, {}))
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../loginput/"))
import index
reload(index)
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
class LoginputTestSuite(HTTPTestSuite):
def setup(self):
from loginput import index
self.application = index.application
super(LoginputTestSuite, self).setup()
@@ -7,6 +7,13 @@ class TestTestRoute(LoginputTestSuite):
status_code = 200
body = ''
class TestStatusRoute(LoginputTestSuite):
routes = ['/status', '/status/']
status_code = 200
body = '{"status": "ok", "service": "loginput"}'
# Routes left need to have unit tests written for:
# @route('/_bulk',method='POST')
# @route('/_bulk/',method='POST')
@@ -14,14 +14,12 @@
sample_config.configfile = os.path.join(os.path.dirname(__file__), '../../rest/index.conf')
OptionParser.parse_args = mock.Mock(return_value=(sample_config, {}))
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../rest/"))
import index
reload(index)
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
class RestTestSuite(HTTPTestSuite):
def setup(self):
from rest import index
self.application = index.application
super(RestTestSuite, self).setup()
@@ -27,7 +27,7 @@ class TestStatusRoute(RestTestSuite):
routes = ['/status', '/status/']
status_code = 200
body = '{"status": "ok"}'
body = '{"status": "ok", "service": "restapi"}'
class TestKibanaDashboardsRoute(RestTestSuite):

0 comments on commit 1067ad0

Please sign in to comment.