diff options
author | 2021-01-05 11:05:17 +0530 | |
---|---|---|
committer | 2021-01-05 12:20:23 +0530 | |
commit | 869b18e4db3be57075cf0deb24d62b33f6c6879a (patch) | |
tree | 715f60c354ed1b978f5cd035f1bc3e0f24b8aa34 /test/adapters/dcae | |
parent | 8323a205518f013598d9177c14ce26bcee9e09a3 (diff) |
Remove ca-cert from docker image
CA cert can be directly used by the
request library. So it is not needed
to install in the base image
Issue-ID: OPTFRA-891
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: Ia7642cded9057148abcaf0f2f8c9e85d63a08012
Diffstat (limited to 'test/adapters/dcae')
-rw-r--r-- | test/adapters/dcae/test_des.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/adapters/dcae/test_des.py b/test/adapters/dcae/test_des.py index 6daa29b..6e2520a 100644 --- a/test/adapters/dcae/test_des.py +++ b/test/adapters/dcae/test_des.py @@ -19,6 +19,7 @@ import mock from mock import patch from requests import RequestException +from requests.exceptions import HTTPError import unittest from osdf.adapters.dcae import des from osdf.adapters.dcae.des import DESException @@ -51,19 +52,20 @@ class TestDes(unittest.TestCase): response.status_code = 200 response.ok = True response.json.return_value = response_json - self.patcher_req = patch('requests.post', return_value=response) + self.patcher_req = patch('requests.request', return_value=response) self.Mock_req = self.patcher_req.start() self.assertEqual(expected, des.extract_data(service_id, data)) self.patcher_req.stop() response = mock.MagicMock() response.status_code = 404 - self.patcher_req = patch('requests.post', return_value=response) + response.raise_for_status.side_effect = HTTPError("404") + self.patcher_req = patch('requests.request', return_value=response) self.Mock_req = self.patcher_req.start() self.assertRaises(DESException, des.extract_data, service_id, data) self.patcher_req.stop() - self.patcher_req = patch('requests.post', side_effect=RequestException("error")) + self.patcher_req = patch('requests.request', side_effect=RequestException("error")) self.Mock_req = self.patcher_req.start() self.assertRaises(DESException, des.extract_data, service_id, data) self.patcher_req.stop() |