summaryrefslogtreecommitdiffstats
path: root/test/test_PolicyCalls.py
diff options
context:
space:
mode:
authorAnkitkumar Patel <ankit@research.att.com>2018-03-27 11:54:53 -0400
committerAnkitkumar Patel <ankit@research.att.com>2018-03-27 11:55:13 -0400
commitf1e95cd95c05be145c3fde9f08404724937edf49 (patch)
tree9b189af4508a2450dc92132e761beebed18ec168 /test/test_PolicyCalls.py
parent4de3bb8c9f62f15d6aeb965f9d4c47edb7efd2e9 (diff)
Updates to address new HPA policies
Issue-ID: OPTFRA-100 Change-Id: Iaff7b50dc5394546cc46591bef9b054cd6cde792 Signed-off-by: Ankitkumar Patel <ankit@research.att.com>
Diffstat (limited to 'test/test_PolicyCalls.py')
-rw-r--r--test/test_PolicyCalls.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_PolicyCalls.py b/test/test_PolicyCalls.py
index 8c0d638..30fc072 100644
--- a/test/test_PolicyCalls.py
+++ b/test/test_PolicyCalls.py
@@ -80,7 +80,7 @@ class TestPolicyCalls(unittest.TestCase):
with patch('osdf.adapters.policy.interface.policy_api_call', return_value=policy_response):
self.assertRaises(BusinessException,
lambda: interface.remote_api(req_json, osdf_config, service_type="placement"))
-
+
def test_get_by_scope(self):
req_json_file = "./test/placement-tests/testScoperequest.json"
all_policies = "./test/placement-tests/policy_response.json"
@@ -100,7 +100,9 @@ class TestPolicyCalls(unittest.TestCase):
genDemandslist = []
req_json = "./test/placement-tests/request.json"
req_json = json.loads(open(req_json).read())
- genDemands = translation.gen_demands(req_json, self.policies)
+ # need to run this only on vnf policies
+ vnf_policies = [x for x in self.policies if x["content"]["policyType"] == "vnfPolicy"]
+ genDemands = translation.gen_demands(req_json, vnf_policies)
for action in req_json['placementInfo']['placementDemands']:
actionsList.append(action['resourceModuleName'])
for key2,value in genDemands.items():