diff options
Diffstat (limited to 'test/conductor')
-rw-r--r-- | test/conductor/test_conductor_calls.py | 15 | ||||
-rw-r--r-- | test/conductor/test_conductor_translation.py | 8 |
2 files changed, 17 insertions, 6 deletions
diff --git a/test/conductor/test_conductor_calls.py b/test/conductor/test_conductor_calls.py index 52e0367..0042ecb 100644 --- a/test/conductor/test_conductor_calls.py +++ b/test/conductor/test_conductor_calls.py @@ -1,5 +1,6 @@ # ------------------------------------------------------------------------- # Copyright (c) 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. @@ -17,7 +18,7 @@ # import unittest -from apps.placement.optimizers.conductor import conductor +from osdf.adapters.conductor import conductor import osdf.config.loader as config_loader from osdf.utils.interfaces import json_from_file from osdf.utils.programming_utils import DotDict @@ -41,12 +42,20 @@ class TestConductorCalls(unittest.TestCase): def test_request(self): req_json = json_from_file("./test/placement-tests/request.json") policies = pol.get_local_policies("test/policy-local-files/", self.lp) - conductor.request(req_json, self.osdf_config, policies) + req_info = req_json['requestInfo'] + demands = req_json['placementInfo']['placementDemands'] + request_parameters = req_json['placementInfo']['requestParameters'] + service_info = req_json['serviceInfo'] + conductor.request(req_info, demands, request_parameters, service_info, self.osdf_config, policies) def test_request_vfmod(self): req_json = json_from_file("./test/placement-tests/request_vfmod.json") policies = pol.get_local_policies("test/policy-local-files/", self.lp) - conductor.request(req_json, self.osdf_config, policies) + req_info = req_json['requestInfo'] + demands = req_json['placementInfo']['placementDemands'] + request_parameters = req_json['placementInfo']['requestParameters'] + service_info = req_json['serviceInfo'] + conductor.request(req_info, demands, request_parameters, service_info, self.osdf_config, policies) if __name__ == "__main__": diff --git a/test/conductor/test_conductor_translation.py b/test/conductor/test_conductor_translation.py index 3481b88..8b6c0a1 100644 --- a/test/conductor/test_conductor_translation.py +++ b/test/conductor/test_conductor_translation.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. @@ -18,7 +19,7 @@ import unittest from osdf.adapters.local_data import local_policies -from apps.placement.optimizers.conductor import translation as tr +from osdf.adapters.conductor import translation as tr from osdf.utils.interfaces import json_from_file @@ -46,14 +47,15 @@ class TestConductorTranslation(unittest.TestCase): # need to run this only on vnf policies vnf_policies = [x for x in self.policies if x[list(x.keys())[0]]["type"] == "onap.policies.optimization.VnfPolicy"] - res = tr.gen_demands(self.request_json, vnf_policies) + res = tr.gen_demands(self.request_json['placementInfo']['placementDemands'], vnf_policies) + assert res is not None def test_gen_vfmod_demands(self): # need to run this only on vnf policies vnf_policies = [x for x in self.policies if x[list(x.keys())[0]]["type"] == "onap.policies.optimization.VnfPolicy"] - res = tr.gen_demands(self.request_vfmod_json, vnf_policies) + res = tr.gen_demands(self.request_vfmod_json['placementInfo']['placementDemands'], vnf_policies) assert res is not None |