aboutsummaryrefslogtreecommitdiffstats
path: root/test/osdf/utils/test_interfaces.py
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2021-01-05 11:05:17 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2021-01-05 12:20:23 +0530
commit869b18e4db3be57075cf0deb24d62b33f6c6879a (patch)
tree715f60c354ed1b978f5cd035f1bc3e0f24b8aa34 /test/osdf/utils/test_interfaces.py
parent8323a205518f013598d9177c14ce26bcee9e09a3 (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/osdf/utils/test_interfaces.py')
-rw-r--r--test/osdf/utils/test_interfaces.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/osdf/utils/test_interfaces.py b/test/osdf/utils/test_interfaces.py
index cdb3d7a..8d66e16 100644
--- a/test/osdf/utils/test_interfaces.py
+++ b/test/osdf/utils/test_interfaces.py
@@ -16,12 +16,13 @@
# -------------------------------------------------------------------------
#
import requests
-import unittest
-
from requests.models import Response
-from osdf.utils.interfaces import RestClient, get_rest_client
+import unittest
from unittest.mock import patch
+from osdf.utils.interfaces import get_rest_client
+from osdf.utils.interfaces import RestClient
+
m1 = Response()
m1._content = b'{"msg": "OK"}'
@@ -39,7 +40,7 @@ class TestOsdfUtilsInterfaces(unittest.TestCase):
def test_rc_request(self, mock_good_response):
rc = RestClient()
rc.add_headers({})
- rc.request(req_id="testReq")
+ rc.request(url="http://localhost", req_id="testReq")
@patch('requests.request', return_value=mock_good_response)
def test_rc_request_v1(self, mock_good_response):
@@ -53,7 +54,7 @@ class TestOsdfUtilsInterfaces(unittest.TestCase):
def test_rc_request_v2(self, mock_bad_response):
rc = RestClient()
try:
- rc.request()
+ rc.request(url="http://localhost")
except requests.RequestException:
return
raise Exception("Allows bad requests instead of raising exception")
@@ -66,4 +67,3 @@ class TestOsdfUtilsInterfaces(unittest.TestCase):
if __name__ == "__main__":
unittest.main()
-