diff --git a/glances/outputs/glances_bottle.py b/glances/outputs/glances_bottle.py index ed5013f2..69af77f7 100644 --- a/glances/outputs/glances_bottle.py +++ b/glances/outputs/glances_bottle.py @@ -230,7 +230,7 @@ class GlancesBottle(object): """ response.status = 200 - return None + return "Active" @compress def _api_help(self): diff --git a/unitest-restful.py b/unitest-restful.py index 362fce61..fa36f88b 100755 --- a/unitest-restful.py +++ b/unitest-restful.py @@ -221,6 +221,16 @@ class TestGlances(unittest.TestCase): self.assertIsInstance(req.json(), dict) self.assertIsInstance(req.json()['interface_name'], list) + def test_012_status(self): + """Check status endpoint.""" + method = "status" + print('INFO: [TEST_012] Status') + print("HTTP RESTful request: %s/%s" % (URL, method)) + req = self.http_get("%s/%s" % (URL, method)) + + self.assertTrue(req.ok) + self.assertEqual(req.text, "Active") + def test_999_stop_server(self): """Stop the Glances Web Server.""" print('INFO: [TEST_999] Stop the Glances Web Server')