mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-24 01:35:23 +03:00
fix: Bottle - /api/%s/status endpoint
prob: failure in compressing `None` with zlib
This commit is contained in:
parent
d3bc9061f4
commit
53c1d64aff
@ -230,7 +230,7 @@ class GlancesBottle(object):
|
||||
"""
|
||||
response.status = 200
|
||||
|
||||
return None
|
||||
return "Active"
|
||||
|
||||
@compress
|
||||
def _api_help(self):
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user