============LICENSE_START=======================================================
org.onap.dcae
================================================================================
-Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
POLICY_BODY = 'policy_body'
POLICIES_FILTERED = 'policies_filtered'
POLICY_FILTER = 'policy_filter'
+LATEST_POLICIES = "latest_policies"
REQUEST_ID = "requestID"
return
res.raise_for_status()
- return res.json()
+ return res.json().get(LATEST_POLICIES)
def _policy_get():
"""
# ============LICENSE_START=======================================================
# org.onap.dcae
# ================================================================================
-# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
POLICY_NAME = "policyName"
POLICY_BODY = 'policy_body'
POLICY_CONFIG = 'config'
+LATEST_POLICIES = "latest_policies"
+
MONKEYED_POLICY_ID = 'monkeyed.Config_peach'
LOG_FILE = 'logs/test_dcaepolicyplugin.log'
self.status_code = 200
self.headers = headers
self.resp_json = resp_json
+ self.text = json.dumps(resp_json or {})
def json(self):
"""returns json of response"""
def monkeyed_policy_handler_find(full_path, json, headers):
"""monkeypatch for the GET to policy-engine"""
return MonkeyedResponse(full_path, headers, \
- {MONKEYED_POLICY_ID: MonkeyedPolicyBody.create_policy(MONKEYED_POLICY_ID)})
+ {LATEST_POLICIES: {
+ MONKEYED_POLICY_ID: MonkeyedPolicyBody.create_policy(MONKEYED_POLICY_ID)}})
def test_policy_find(monkeypatch):
"""test policy_get operation on dcae.nodes.policies node"""