From b9b955c0c2875effc1ce02d5576f0d2a59284c5d Mon Sep 17 00:00:00 2001 From: Alex Shatov Date: Thu, 8 Mar 2018 13:12:23 -0500 Subject: 2.2.0 policy-handler - customization per company - added etc_customize/ folder and customize.sh script = customize.sh script is expected to be overridden by company to customize Docker image build = the whole etc_customize/ folder is copied into docker image = it is up to the company what to put into that folder - any files - added customize/ folder with CustomizeBase and Customize classes = CustomizeBase defines the interface and the default=ONAP behavior = CustomizeBase is owned by ONAP and should not be changed by the company = Customize inherits CustomizeBase = policy-handler instantiates Customize to get the customized behavior = Customize is owned by the company and should be changed by the company = ONAP is not going to change Customize = the methods of Customize are expected to be overridden by the company to change the behavior of the policy-handler = sample Customize class can be found in README.md = Company is allowed to add more files to customize/ folder if that is required for better structuring of their code as soon as it is invoked by the methods of Customize Change-Id: I46f8170afaaa48e1005e4398a768a781db0a0e6c Signed-off-by: Alex Shatov Issue-ID: DCAEGEN2-379 --- tests/test_policyhandler.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/test_policyhandler.py b/tests/test_policyhandler.py index f47d9d0..375c358 100644 --- a/tests/test_policyhandler.py +++ b/tests/test_policyhandler.py @@ -47,7 +47,7 @@ from policyhandler.policy_rest import PolicyRest from policyhandler.policy_utils import PolicyUtils from policyhandler.web_server import _PolicyWeb -POLICY_HANDLER_VERSION = "2.0.0" +POLICY_HANDLER_VERSION = "2.2.0" class MonkeyHttpResponse(object): """Monkey http reposne""" @@ -77,8 +77,8 @@ def monkeyed_discovery(full_path): res_json = {} if full_path == DiscoveryClient.CONSUL_SERVICE_MASK.format(Config.config["deploy_handler"]): res_json = [{ - DiscoveryClient.SERVICE_ADDRESS: "1.1.1.1", - DiscoveryClient.SERVICE_PORT: "123" + "ServiceAddress": "1.1.1.1", + "ServicePort": "123" }] elif full_path == DiscoveryClient.CONSUL_KV_MASK.format(Config.get_system_name()): res_json = copy.deepcopy(Settings.dicovered_config) @@ -267,7 +267,8 @@ def monkeyed_deploy_handler(full_path, json=None, headers=None): def fix_deploy_handler(monkeypatch, fix_discovery): """monkeyed discovery request.get""" Settings.logger.info("setup fix_deploy_handler") - DeployHandler._lazy_init() + audit = Audit(req_message="fix_deploy_handler") + DeployHandler._lazy_init(audit) monkeypatch.setattr('policyhandler.deploy_handler.DeployHandler._requests_session.post', monkeyed_deploy_handler) yield fix_deploy_handler # provide the fixture value -- cgit 1.2.3-korg