This patch creates a new endpoint /ping in v1.1 API, which is a clone of the /health endpoint in v1.0. Because a new /health endpoint will be added in v1.1 to return more detailed KPI of Marconi server. Implement blueprint: api-v1.1-ping-endpoint Change-Id: I486c8a3583fc557c0b0578b0f73a6c6a2a3748b3
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
# Copyright 2014 IBM Corp.
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
# implied.
|
|
#
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
import falcon
|
|
|
|
from . import base # noqa
|
|
|
|
|
|
class TestPing(base.TestBase):
|
|
|
|
config_file = 'wsgi_sqlite.conf'
|
|
|
|
def test_get(self):
|
|
response = self.simulate_get('/v1.1/ping')
|
|
self.assertEqual(self.srmock.status, falcon.HTTP_204)
|
|
self.assertEqual(response, [])
|
|
|
|
def test_head(self):
|
|
response = self.simulate_head('/v1.1/ping')
|
|
self.assertEqual(self.srmock.status, falcon.HTTP_204)
|
|
self.assertEqual(response, [])
|