summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Ke <lokyse@163.com>2018-03-26 04:11:49 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-26 04:11:49 +0000
commitb3398d2b776f532004dbcd975633d79bb2ca246d (patch)
tree9fce941aff956d8175fbae1fa9db9860e6ffb962
parent12458dd50ca4033fa2bbecadfefca9c3d0fe25ae (diff)
parent0b2cfa524556bf4e1541706ecb94e807cf0995bb (diff)
Merge "Add test_originHeaders"
-rw-r--r--multivimbroker/multivimbroker/tests/test_syscomm.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/multivimbroker/multivimbroker/tests/test_syscomm.py b/multivimbroker/multivimbroker/tests/test_syscomm.py
index b80047d..1e88aa2 100644
--- a/multivimbroker/multivimbroker/tests/test_syscomm.py
+++ b/multivimbroker/multivimbroker/tests/test_syscomm.py
@@ -52,3 +52,15 @@ class TestSyscomm(unittest.TestCase):
vim = {"type": "openstack", "version": "titanium_cloud"}
ret = syscomm.findMultivimDriver(vim)
self.assertEqual("multicloud-titanium_cloud", ret)
+
+ def test_originHeaders(self):
+ req = mock.Mock()
+ req.META = {
+ "HTTP_X_AUTH_TOKEN": "token_1",
+ "NOT_STARTSWITH_HTTP": "value_1"
+ }
+ expect_headers = {
+ "X-AUTH-TOKEN": "token_1"
+ }
+ ret_headers = syscomm.originHeaders(req)
+ self.assertDictEqual(expect_headers, ret_headers)