1 # -------------------------------------------------------------------------
\r
2 # Copyright (c) 2017-2018 AT&T Intellectual Property
\r
4 # Licensed under the Apache License, Version 2.0 (the "License");
\r
5 # you may not use this file except in compliance with the License.
\r
6 # You may obtain a copy of the License at
\r
8 # http://www.apache.org/licenses/LICENSE-2.0
\r
10 # Unless required by applicable law or agreed to in writing, software
\r
11 # distributed under the License is distributed on an "AS IS" BASIS,
\r
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 # See the License for the specific language governing permissions and
\r
14 # limitations under the License.
\r
16 # -------------------------------------------------------------------------
\r
20 from osdf.optimizers.placementopt.conductor.translation import get_opt_query_data
\r
23 class TestGetOptQueryData(unittest.TestCase):
\r
25 def test_get_opt_query_data(self):
\r
27 parameter_data_file = main_dir + "test/placement-tests/request.json"
\r
28 policy_data_path = main_dir + "test/policy-local-files/"
\r
30 query_policy_data_file = ["QueryPolicy_vCPE.json"]
\r
31 request_json = json.loads(open(parameter_data_file).read())
\r
32 policies = [json.loads(open(policy_data_path + file).read()) for file in query_policy_data_file]
\r
33 req_param_dict = get_opt_query_data(request_json, policies)
\r
35 self.assertTrue(req_param_dict is not None)
\r
38 if __name__ == "__main__":
\r