diff options
author | Ethan Lynn <ethanlynnl@vmware.com> | 2018-03-25 19:58:46 -0700 |
---|---|---|
committer | Ethan Lynn <ethanlynnl@vmware.com> | 2018-03-25 19:59:19 -0700 |
commit | 0b2cfa524556bf4e1541706ecb94e807cf0995bb (patch) | |
tree | 748df452c085ebe9fbf16c36cc4f9d289352b8d0 /multivimbroker | |
parent | 2d6dbe8d001558faace5f0b17196f7ea5ae10d8c (diff) |
Add test_originHeaders
Add test_originHeaders for syscomm.py
Change-Id: I2359c6905943fb8c0de54c44626987837b7ed4a6
Issue-ID: MULTICLOUD-198
Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
Diffstat (limited to 'multivimbroker')
-rw-r--r-- | multivimbroker/multivimbroker/tests/test_syscomm.py | 12 |
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) |