summaryrefslogtreecommitdiff
path: root/test/apiv2/python
diff options
context:
space:
mode:
Diffstat (limited to 'test/apiv2/python')
-rw-r--r--test/apiv2/python/rest_api/test_v2_0_0_system.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/apiv2/python/rest_api/test_v2_0_0_system.py b/test/apiv2/python/rest_api/test_v2_0_0_system.py
index 3e94f187d..8171abb84 100644
--- a/test/apiv2/python/rest_api/test_v2_0_0_system.py
+++ b/test/apiv2/python/rest_api/test_v2_0_0_system.py
@@ -1,5 +1,6 @@
import json
import unittest
+import uuid
import requests
from .fixtures import APITestCase
@@ -100,6 +101,18 @@ class SystemTestCase(APITestCase):
r = requests.get(self.uri("/system/df"))
self.assertEqual(r.status_code, 200, r.text)
+ def test_reference_id(self):
+ rid = str(uuid.uuid4())
+ r = requests.get(self.uri("/info"), headers={"X-Reference-Id": rid})
+ self.assertEqual(r.status_code, 200, r.text)
+
+ self.assertIn("X-Reference-Id", r.headers)
+ self.assertEqual(r.headers["X-Reference-Id"], rid)
+
+ r = requests.get(self.uri("/info"))
+ self.assertIn("X-Reference-Id", r.headers)
+ self.assertNotEqual(r.headers["X-Reference-Id"], rid)
+
if __name__ == "__main__":
unittest.main()