Use List for allowed_origin

... to get rid of the following warning in unit test jobs.

DEPRECATED: The `allowed_origin` keyword argument in `add_origin()`
should be a list, found String.

Change-Id: I6265fa1bea2c05d9b46f45802e8766d702ae1ff7
This commit is contained in:
Takashi Kajinami 2021-07-23 20:43:07 +09:00
parent 82ea5d5680
commit 727da0ffa9

View File

@ -39,7 +39,7 @@ class TestCORSMiddleware(integrated_helpers._IntegratedTestBase):
def _mock_getattr(instance, key):
if key != 'allowed_origin':
return self._original_call_method(instance, key)
return "http://valid.example.com"
return ["http://valid.example.com"]
self._original_call_method = cfg.ConfigOpts.GroupAttr.__getattr__
cfg.ConfigOpts.GroupAttr.__getattr__ = _mock_getattr