summaryrefslogtreecommitdiffstats
path: root/test/test_ConductorApiBuilder.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_ConductorApiBuilder.py')
-rw-r--r--test/test_ConductorApiBuilder.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/test/test_ConductorApiBuilder.py b/test/test_ConductorApiBuilder.py
index 07cb3bb..44c14d8 100644
--- a/test/test_ConductorApiBuilder.py
+++ b/test/test_ConductorApiBuilder.py
@@ -1,5 +1,6 @@
# -------------------------------------------------------------------------
# Copyright (c) 2017-2018 AT&T Intellectual Property
+# Copyright (C) 2020 Wipro Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,7 +20,7 @@ import unittest
import json
import yaml
-from apps.placement.optimizers.conductor.api_builder import conductor_api_builder
+from osdf.adapters.conductor.api_builder import conductor_api_builder
from osdf.adapters.local_data import local_policies
from osdf.utils.interfaces import json_from_file
@@ -28,7 +29,7 @@ class TestConductorApiBuilder(unittest.TestCase):
def setUp(self):
self.main_dir = ""
- self.conductor_api_template = self.main_dir + "apps/placement/templates/conductor_interface.json"
+ self.conductor_api_template = self.main_dir + "osdf/adapters/conductor/templates/conductor_interface.json"
self.local_config_file = self.main_dir + "config/common_config.yaml"
policy_data_path = self.main_dir + "test/policy-local-files" # "test/policy-local-files"
@@ -48,7 +49,12 @@ class TestConductorApiBuilder(unittest.TestCase):
request_json = self.request_json
policies = self.policies
local_config = yaml.safe_load(open(self.local_config_file))
- templ_string = conductor_api_builder(request_json, policies, local_config, self.conductor_api_template)
+ req_info = request_json['requestInfo']
+ demands = request_json['placementInfo']['placementDemands']
+ request_parameters = request_json['placementInfo']['requestParameters']
+ service_info = request_json['serviceInfo']
+ templ_string = conductor_api_builder(req_info, demands, request_parameters, service_info, policies,
+ local_config, self.conductor_api_template)
templ_json = json.loads(templ_string)
self.assertEqual(templ_json["name"], "yyy-yyy-yyyy")
@@ -56,7 +62,12 @@ class TestConductorApiBuilder(unittest.TestCase):
request_json = self.request_vfmod_json
policies = self.policies
local_config = yaml.safe_load(open(self.local_config_file))
- templ_string = conductor_api_builder(request_json, policies, local_config, self.conductor_api_template)
+ req_info = request_json['requestInfo']
+ demands = request_json['placementInfo']['placementDemands']
+ request_parameters = request_json['placementInfo']['requestParameters']
+ service_info = request_json['serviceInfo']
+ templ_string = conductor_api_builder(req_info, demands, request_parameters, service_info, policies,
+ local_config, self.conductor_api_template)
templ_json = json.loads(templ_string)
self.assertEqual(templ_json, self.request_placement_vfmod_json)