1 # -------------------------------------------------------------------------
2 # Copyright (c) 2018 AT&T Intellectual Property
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # -------------------------------------------------------------------------
19 from apps.pci.optimizers.config_request import request
20 import osdf.config.loader as config_loader
21 from osdf.utils.interfaces import json_from_file
22 from osdf.utils.programming_utils import DotDict
23 from osdf.adapters.policy import interface as pol
26 class TestConfigDbCalls():
30 "deployment": "test/functest/simulators/simulated-config/osdf_config.yaml",
31 "core": "test/functest/simulators/simulated-config/common_config.yaml"
33 self.osdf_config = DotDict(config_loader.all_configs(**self.config_spec))
34 self.lp = self.osdf_config.core.get('osdf_temp', {}).get('local_policies', {}
35 ).get('placement_policy_files_vcpe')
40 def test_request(self):
42 req_json = json_from_file("./test/pci-optimization-tests/request.json")
43 policies = pol.get_local_policies("test/policy-local-files/", self.lp)
44 cell_list = request(req_json, self.osdf_config, policies)