summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xunitest-restful.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/unitest-restful.py b/unitest-restful.py
index 08f7c27f..faf1fe8f 100755
--- a/unitest-restful.py
+++ b/unitest-restful.py
@@ -257,6 +257,20 @@ class TestGlances(unittest.TestCase):
self.assertTrue(req.headers['Content-Encoding'] == 'gzip')
self.assertTrue(req.json(), dict)
+ def test_016_fields_description(self):
+ """Fields description."""
+ print('INFO: [TEST_016] Get fields description and unit')
+
+ print("HTTP RESTful request: %s/cpu/total/description" % URL)
+ req = self.http_get("%s/cpu/total/description" % URL)
+ self.assertTrue(req.ok)
+ self.assertTrue(req.json(), str)
+
+ print("HTTP RESTful request: %s/cpu/total/unit" % URL)
+ req = self.http_get("%s/cpu/total/unit" % URL)
+ self.assertTrue(req.ok)
+ self.assertTrue(req.json(), str)
+
def test_999_stop_server(self):
"""Stop the Glances Web Server."""
print('INFO: [TEST_999] Stop the Glances Web Server')