diff options
author | 2020-05-14 18:22:46 +0530 | |
---|---|---|
committer | 2020-05-14 18:22:46 +0530 | |
commit | 349bbf794dbc34a96755ae40e98b8ba83a074a02 (patch) | |
tree | a62e3aafc9cc385ed09dcbe619a5790962a19033 /test/apps/slice_selection/test_remote_opt_processor.py | |
parent | 0227fc0b5a69558cb68fd9977e12558fbb51a203 (diff) |
Handle has exceptions for slice selection
Issue-ID: OPTFRA-754
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: I66904680a4b9a2bc69c144f05b95fb4f999d0e93
Diffstat (limited to 'test/apps/slice_selection/test_remote_opt_processor.py')
-rw-r--r-- | test/apps/slice_selection/test_remote_opt_processor.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/apps/slice_selection/test_remote_opt_processor.py b/test/apps/slice_selection/test_remote_opt_processor.py index 136bb71..5321880 100644 --- a/test/apps/slice_selection/test_remote_opt_processor.py +++ b/test/apps/slice_selection/test_remote_opt_processor.py @@ -18,7 +18,7 @@ import json
import unittest
-from requests import RequestException
+from requests import RequestException, Response
from apps.slice_selection.optimizers.conductor.remote_opt_processor import process_nsi_selection_opt
from osdf.adapters.local_data import local_policies
@@ -102,8 +102,10 @@ class TestRemoteOptProcessor(unittest.TestCase): conductor_error_response_file = 'test/apps/slice_selection/conductor_error_response.json'
conductor_error_response = json_from_file(conductor_error_response_file)
+ response = Response()
+ response._content = json.dumps(conductor_error_response).encode()
self.patcher_req = patch('osdf.adapters.conductor.conductor.request',
- side_effect=RequestException(response=json.dumps(conductor_error_response)))
+ side_effect=RequestException(response=response))
self.Mock_req = self.patcher_req.start()
self.assertEquals(error_response_json, process_nsi_selection_opt(request_json, self.osdf_config))
self.patcher_req.stop()
|