X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=test%2Fapps%2Fnxi_termination%2Ftest_remote_opt_processor_termination.py;fp=test%2Fapps%2Fnxi_termination%2Ftest_remote_opt_processor_termination.py;h=555f2e81cfae56d1c01e45f3f74100a669383c10;hb=e35d4a1b94bbcd844300282d1c3c8722ef58062d;hp=9fbc27bccd3281e3e4fb389aca511091c46168b3;hpb=92373ddd2e28cc2000a2634d273836fea5d87a6e;p=optf%2Fosdf.git diff --git a/test/apps/nxi_termination/test_remote_opt_processor_termination.py b/test/apps/nxi_termination/test_remote_opt_processor_termination.py index 9fbc27b..555f2e8 100644 --- a/test/apps/nxi_termination/test_remote_opt_processor_termination.py +++ b/test/apps/nxi_termination/test_remote_opt_processor_termination.py @@ -69,13 +69,13 @@ class TestRemoteOptProcessor(unittest.TestCase): exception_response_json1 = json_from_file(exception_response_file1) #nsi success scenario - self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_resource_count', return_value=1) + self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_allotted_resources', return_value=success_rel_json) self.Mock_req = self.patcher_req.start() self.assertEquals(success_output_json, process_nxi_termination_opt(request_json, osdf_config)) self.patcher_req.stop() #nsi failure scenario - self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_resource_count', return_value=3) + self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_allotted_resources', return_value=failure_rel_json) self.Mock_req = self.patcher_req.start() self.assertEquals(nxi_failure_output_json1, process_nxi_termination_opt(request_json, osdf_config)) self.patcher_req.stop() @@ -83,18 +83,12 @@ class TestRemoteOptProcessor(unittest.TestCase): request_json["requestInfo"]["addtnlArgs"] = {} #nsi success scenario - self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_resource_count', - return_value=0) + self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_allotted_resources', + return_value=[]) self.Mock_req = self.patcher_req.start() self.assertEquals(success_output_json, process_nxi_termination_opt(request_json, osdf_config)) self.patcher_req.stop() - # nsi failure scenario - self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_resource_count', - return_value=1) - self.Mock_req = self.patcher_req.start() - self.assertEquals(nxi_failure_output_json2, process_nxi_termination_opt(request_json, osdf_config)) - self.patcher_req.stop() # # # nssi success scenario self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_resource_count', return_value=1)