From 718d598d6a0691a95063459c5f362ff906407a38 Mon Sep 17 00:00:00 2001 From: serhiy Date: Tue, 21 May 2024 09:22:21 +0100 Subject: [PATCH] Update verify parameter - Instead of passing in a verify parameter for every request, set it on startup - update unit tests to reflect this - black formatting --- archivist/archivist.py | 46 +++++++++--------- archivist/archivistpublic.py | 4 +- archivist/confirmer.py | 12 ++--- functests/execassets.py | 6 +-- requirements.txt | 2 +- unittests/testaccess_policies.py | 10 ---- unittests/testappidp.py | 1 - unittests/testapplications.py | 7 --- unittests/testarchivist.py | 3 -- unittests/testarchivistdelete.py | 3 -- unittests/testarchivistget.py | 5 -- unittests/testarchivistlist.py | 7 --- unittests/testarchivistpost.py | 10 ++-- unittests/testarchivistsignature.py | 1 - unittests/testassetattachments.py | 2 - unittests/testassets.py | 1 - unittests/testassetsconstants.py | 6 --- unittests/testassetslist.py | 3 -- unittests/testassetsread.py | 3 -- unittests/testassetswait.py | 63 ++----------------------- unittests/testattachments.py | 6 +-- unittests/testcompliance.py | 1 - unittests/testcompliance_policies.py | 8 ---- unittests/testevents.py | 1 - unittests/testeventscount.py | 4 -- unittests/testeventscreate.py | 6 --- unittests/testeventslist.py | 4 -- unittests/testeventsread.py | 1 - unittests/testeventswait.py | 1 - unittests/testlocations.py | 11 ----- unittests/testpublicassetattachments.py | 2 - unittests/testpublicassetsread.py | 1 - unittests/testpublicevents.py | 7 --- unittests/testpublicget.py | 5 -- unittests/testsubjects.py | 12 ----- unittests/testtenancies.py | 2 - 36 files changed, 39 insertions(+), 228 deletions(-) diff --git a/archivist/archivist.py b/archivist/archivist.py index 136eb4ea..a4f104f1 100644 --- a/archivist/archivist.py +++ b/archivist/archivist.py @@ -1,34 +1,35 @@ # -*- coding: utf-8 -*- """Archivist connection interface - This module contains the base Archivist class which manages - the connection parameters to a DataTrails instance and - the basic REST verbs to GET, POST, PATCH and DELETE entities.. +This module contains the base Archivist class which manages +the connection parameters to a DataTrails instance and +the basic REST verbs to GET, POST, PATCH and DELETE entities.. - The REST methods in this class should only be used directly when - a CRUD endpoint for the specific type of entity is unavailable. - Current CRUD endpoints are assets, events, locations, attachments. - IAM subjects and IAM access policies. +The REST methods in this class should only be used directly when +a CRUD endpoint for the specific type of entity is unavailable. +Current CRUD endpoints are assets, events, locations, attachments. +IAM subjects and IAM access policies. - Instantiation of this class encapsulates the URL and authentication - parameters (the max_time parameter is optional): +Instantiation of this class encapsulates the URL and authentication +parameters (the max_time parameter is optional): - .. code-block:: python +.. code-block:: python - with open(".auth_token", mode="r", encoding="utf-8") as tokenfile: - authtoken = tokenfile.read().strip() + with open(".auth_token", mode="r", encoding="utf-8") as tokenfile: + authtoken = tokenfile.read().strip() - # Initialize connection to Archivist - arch = Archivist( - "https://app.datatrails.ai", - authtoken, - max_time=300.0, - ) + # Initialize connection to Archivist + arch = Archivist( + "https://app.datatrails.ai", + authtoken, + max_time=300.0, + ) - The arch variable now has additional endpoints assets,events,locations, - attachments, IAM subjects and IAM access policies documented elsewhere. + The arch variable now has additional endpoints assets,events,locations, + attachments, IAM subjects and IAM access policies documented elsewhere. """ + from copy import deepcopy from logging import getLogger from time import time @@ -253,14 +254,12 @@ def post( response = self.session.post( url, data=request, - verify=self.verify, ) else: response = self.session.post( url, json=request, headers=self._add_headers(headers), - verify=self.verify, ) error = _parse_response(response) @@ -305,7 +304,6 @@ def post_file( url, data=multipart, # pyright: ignore https://github.com/requests/toolbelt/issues/312 headers=self._add_headers(headers), - verify=self.verify, params=_dotdict(params), ) @@ -335,7 +333,6 @@ def delete( response = self.session.delete( url, headers=self._add_headers(headers), - verify=self.verify, ) self._response_ring_buffer.appendleft(response) @@ -371,7 +368,6 @@ def patch( url, json=request, headers=self._add_headers(headers), - verify=self.verify, ) self._response_ring_buffer.appendleft(response) diff --git a/archivist/archivistpublic.py b/archivist/archivistpublic.py index 268e5f30..9480b207 100644 --- a/archivist/archivistpublic.py +++ b/archivist/archivistpublic.py @@ -122,6 +122,7 @@ def session(self) -> requests.Session: """creates and returns session""" if self._session is None: self._session = requests.Session() + self._session.verify = self.verify return self._session def close(self): @@ -197,7 +198,6 @@ def get( response = self.session.get( url, headers=self._add_headers(headers), - verify=self.verify, params=_dotdict(params), ) @@ -237,7 +237,6 @@ def get_file( response = self.session.get( url, headers=self._add_headers(headers), - verify=self.verify, stream=True, params=_dotdict(params), ) @@ -272,7 +271,6 @@ def __list( response = self.session.get( url, headers=self._add_headers(headers), - verify=self.verify, params=_dotdict(params), ) diff --git a/archivist/confirmer.py b/archivist/confirmer.py index 86ea9d0e..420cf98d 100644 --- a/archivist/confirmer.py +++ b/archivist/confirmer.py @@ -52,32 +52,28 @@ def __on_giveup_confirmation(details: "Details"): def _wait_for_confirmation( self: "_AssetsRestricted", identity: str, -) -> "Asset": - ... # pragma: no cover +) -> "Asset": ... # pragma: no cover @overload def _wait_for_confirmation( self: "_AssetsPublic", identity: str, -) -> "Asset": - ... # pragma: no cover +) -> "Asset": ... # pragma: no cover @overload def _wait_for_confirmation( self: "_EventsRestricted", identity: str, -) -> "Event": - ... # pragma: no cover +) -> "Event": ... # pragma: no cover @overload def _wait_for_confirmation( self: "_EventsPublic", identity: str, -) -> "Event": - ... # pragma: no cover +) -> "Event": ... # pragma: no cover @backoff.on_predicate( diff --git a/functests/execassets.py b/functests/execassets.py index c7827331..06afe89a 100644 --- a/functests/execassets.py +++ b/functests/execassets.py @@ -129,9 +129,9 @@ def setUp(self): self.traffic_light = deepcopy(ATTRS) self.traffic_light["arc_display_type"] = "Traffic light with violation camera" self.traffic_light_merkle_log = deepcopy(ATTRS) - self.traffic_light_merkle_log[ - "arc_display_type" - ] = "Traffic light with violation camera (merkle_log)" + self.traffic_light_merkle_log["arc_display_type"] = ( + "Traffic light with violation camera (merkle_log)" + ) def tearDown(self): self.arch.close() diff --git a/requirements.txt b/requirements.txt index 013b96e0..2f48c9fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ flatten-dict~=0.4 iso8601~=2.1 Jinja2~=3.1 pyaml-env~=1.2 -requests~=2.31.0 +requests~=2.32.0 requests-toolbelt~=1.0 rfc3339~=6.2 xmltodict~=0.13 diff --git a/unittests/testaccess_policies.py b/unittests/testaccess_policies.py index 45c91b1c..96e09827 100644 --- a/unittests/testaccess_policies.py +++ b/unittests/testaccess_policies.py @@ -127,7 +127,6 @@ def test_access_policies_create(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method called incorrectly", ) @@ -159,7 +158,6 @@ def test_access_policies_read(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -181,7 +179,6 @@ def test_access_policies_delete(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, ), msg="DELETE method called incorrectly", @@ -211,7 +208,6 @@ def test_access_policies_update(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="PATCH method kwargs called incorrectly", ) @@ -249,7 +245,6 @@ def test_access_policies_count(self): HEADERS_REQUEST_TOTAL_COUNT: "true", }, "params": {"page_size": 1}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -289,7 +284,6 @@ def test_access_policies_count_by_name(self): "page_size": 1, "display_name": "Policy display name", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -330,7 +324,6 @@ def test_access_policies_list(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -375,7 +368,6 @@ def test_access_policies_list_by_name(self): "authorization": "Bearer authauthauth", }, "params": {"display_name": "Policy display name"}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -421,7 +413,6 @@ def test_access_policies_list_matching_access_policies(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -464,7 +455,6 @@ def test_access_policies_list_matching_assets(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testappidp.py b/unittests/testappidp.py index bc1a8f43..fd8dc62a 100644 --- a/unittests/testappidp.py +++ b/unittests/testappidp.py @@ -79,7 +79,6 @@ def test_appidp_token_create(self): kwargs, { "data": REQUEST, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) diff --git a/unittests/testapplications.py b/unittests/testapplications.py index b2672430..c79f57e1 100644 --- a/unittests/testapplications.py +++ b/unittests/testapplications.py @@ -95,7 +95,6 @@ def test_applications_create(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -122,7 +121,6 @@ def test_applications_read(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -144,7 +142,6 @@ def test_applications_delete(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, ), msg="DELETE method called incorrectly", @@ -170,7 +167,6 @@ def test_applications_update(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, ), msg="PATCH method called incorrectly", @@ -220,7 +216,6 @@ def test_applications_list(self): "authorization": "Bearer authauthauth", }, "params": {}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -267,7 +262,6 @@ def test_applications_list_by_name(self): "params": { "display_name": "Application display name", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -295,7 +289,6 @@ def test_applications_regenerate(self): "authorization": "Bearer authauthauth", }, "json": None, - "verify": True, }, ), msg="POST method called incorrectly", diff --git a/unittests/testarchivist.py b/unittests/testarchivist.py index 43d77f5d..881bb609 100644 --- a/unittests/testarchivist.py +++ b/unittests/testarchivist.py @@ -269,7 +269,6 @@ def test_patch(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="POST method kwargs called incorrectly", ) @@ -312,7 +311,6 @@ def test_patch_with_headers(self): "authorization": "Bearer authauthauth", "headerfield1": "headervalue1", }, - "verify": True, }, msg="PATCH method kwargs called incorrectly", ) @@ -389,7 +387,6 @@ def test_patch_with_429_retry_and_success(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="PATCH method kwargs called incorrectly", ) diff --git a/unittests/testarchivistdelete.py b/unittests/testarchivistdelete.py index 1079bdbc..f60f25c8 100644 --- a/unittests/testarchivistdelete.py +++ b/unittests/testarchivistdelete.py @@ -50,7 +50,6 @@ def test_delete(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, ), msg="DELETE method called incorrectly", @@ -84,7 +83,6 @@ def test_delete_with_headers(self): "authorization": "Bearer authauthauth", "headerfield1": "headervalue1", }, - "verify": True, }, ), msg="DELETE method called incorrectly", @@ -147,7 +145,6 @@ def test_delete_with_429_retry_and_success(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, ), msg="DELETE method called incorrectly", diff --git a/unittests/testarchivistget.py b/unittests/testarchivistget.py index 96f56b0f..151da3b7 100644 --- a/unittests/testarchivistget.py +++ b/unittests/testarchivistget.py @@ -52,7 +52,6 @@ def test_get(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -97,7 +96,6 @@ def test_get_with_headers(self): "headerfield1": "headervalue1", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -161,7 +159,6 @@ def test_get_with_429_retry_and_success(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -210,7 +207,6 @@ def filedata(chunk_size=4096): # pylint: disable=unused-argument "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, "stream": True, "params": None, }, @@ -303,7 +299,6 @@ def filedata(chunk_size=4096): # pylint: disable=unused-argument "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, "stream": True, "params": None, }, diff --git a/unittests/testarchivistlist.py b/unittests/testarchivistlist.py index 15837a71..5c848663 100644 --- a/unittests/testarchivistlist.py +++ b/unittests/testarchivistlist.py @@ -58,7 +58,6 @@ def test_list(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -132,7 +131,6 @@ def test_list_with_headers(self): "headerfield1": "headervalue1", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -172,7 +170,6 @@ def test_list_with_params(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, "params": {"paramsfield1": "paramsvalue1"}, }, ), @@ -218,7 +215,6 @@ def test_list_with_page_size(self): "authorization": "Bearer authauthauth", }, "params": {"page_size": 2}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -285,7 +281,6 @@ def test_list_with_multiple_pages(self): "authorization": "Bearer authauthauth", }, "params": paging[i], - "verify": True, }, ), msg="GET method called incorrectly", @@ -357,7 +352,6 @@ def test_list_with_multiple_pages_and_params(self): "authorization": "Bearer authauthauth", }, "params": paging[i], - "verify": True, }, ), msg="GET method called incorrectly", @@ -439,7 +433,6 @@ def test_list_with_429_retry_and_success(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testarchivistpost.py b/unittests/testarchivistpost.py index 95fc442c..579f101a 100644 --- a/unittests/testarchivistpost.py +++ b/unittests/testarchivistpost.py @@ -57,7 +57,6 @@ def test_post(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="POST method kwargs called incorrectly", ) @@ -135,7 +134,6 @@ def test_post_with_429_retry_and_success(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="POST method kwargs called incorrectly", ) @@ -166,7 +164,6 @@ def test_post_with_headers(self): "authorization": "Bearer authauthauth", "headerfield1": "headervalue1", }, - "verify": True, }, msg="POST method kwargs called incorrectly", ) @@ -195,7 +192,7 @@ def test_post_file(self): ) self.assertEqual( len(kwargs), - 4, + 3, msg="Incorrect number of keyword arguments", ) headers = kwargs.get("headers") @@ -260,7 +257,7 @@ def test_post_file_with_params(self): ) self.assertEqual( len(kwargs), - 4, + 3, msg="Incorrect number of keyword arguments", ) headers = kwargs.get("headers") @@ -389,7 +386,7 @@ def test_post_file_with_429_retry_and_success(self): ) self.assertEqual( len(kwargs), - 4, + 3, msg="Incorrect number of keyword arguments", ) headers = kwargs.get("headers") @@ -457,7 +454,6 @@ def test_post_without_auth(self): { "json": request, "headers": {}, - "verify": True, }, msg="POST method kwargs called incorrectly", ) diff --git a/unittests/testarchivistsignature.py b/unittests/testarchivistsignature.py index b4ddc90c..dddccf69 100644 --- a/unittests/testarchivistsignature.py +++ b/unittests/testarchivistsignature.py @@ -52,7 +52,6 @@ def test_get_by_signature(self): "authorization": "Bearer authauthauth", }, "params": {"field1": "value1", "page_size": 2}, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testassetattachments.py b/unittests/testassetattachments.py index 8be24ac8..0d6d02a6 100644 --- a/unittests/testassetattachments.py +++ b/unittests/testassetattachments.py @@ -137,7 +137,6 @@ def filedata(chunk_size=4096): # pylint: disable=unused-argument }, "params": expected_params, "stream": True, - "verify": True, }, msg="DOWNLOAD method called incorrectly", ) @@ -206,7 +205,6 @@ def test_assetattachments_info(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, msg="INFO method called incorrectly", ) diff --git a/unittests/testassets.py b/unittests/testassets.py index 5232ff9d..67f8c2ae 100644 --- a/unittests/testassets.py +++ b/unittests/testassets.py @@ -411,7 +411,6 @@ def test_assets_create_if_not_exists_existing_asset(self): "attributes.arc_display_name": "tcl.ppj.003", "page_size": 2, }, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testassetsconstants.py b/unittests/testassetsconstants.py index eb24d7b2..7cd371ce 100644 --- a/unittests/testassetsconstants.py +++ b/unittests/testassetsconstants.py @@ -134,7 +134,6 @@ "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, } REQUEST_KWARGS_SIMPLE_HASH = { "json": { @@ -157,7 +156,6 @@ "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, } RESPONSE_SIMPLE_HASH = { "identity": IDENTITY, @@ -255,7 +253,6 @@ "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, } RESPONSE_EXISTS = { "identity": IDENTITY, @@ -343,7 +340,6 @@ "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, } RESPONSE_ATTACHMENTS = { "arc_attribute_type": "arc_attachment", @@ -441,7 +437,6 @@ "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, } RESPONSE_EXISTS_LOCATION = { "identity": IDENTITY, @@ -511,7 +506,6 @@ "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, } RESPONSE_FIXTURES = { diff --git a/unittests/testassetslist.py b/unittests/testassetslist.py index 962ceb2a..f43069dc 100644 --- a/unittests/testassetslist.py +++ b/unittests/testassetslist.py @@ -68,7 +68,6 @@ def test_assets_list(self): "authorization": "Bearer authauthauth", }, "params": {}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -119,7 +118,6 @@ def test_assets_list_with_params(self): "confirmation_status": "CONFIRMED", "attributes.arc_firmware_version": "1.0", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -153,7 +151,6 @@ def test_assets_read_by_signature(self): "authorization": "Bearer authauthauth", }, "params": {"page_size": 2}, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testassetsread.py b/unittests/testassetsread.py index 90ad5886..f347b585 100644 --- a/unittests/testassetsread.py +++ b/unittests/testassetsread.py @@ -127,7 +127,6 @@ def test_assets_count(self): HEADERS_REQUEST_TOTAL_COUNT: "true", }, "params": {"page_size": 1}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -164,7 +163,6 @@ def test_assets_count_with_props_params(self): "page_size": 1, "confirmation_status": "CONFIRMED", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -199,7 +197,6 @@ def test_assets_count_with_attrs_params(self): "page_size": 1, "attributes.arc_firmware_version": "1.0", }, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testassetswait.py b/unittests/testassetswait.py index 6065f326..84d6992f 100644 --- a/unittests/testassetswait.py +++ b/unittests/testassetswait.py @@ -93,7 +93,6 @@ def test_assets_wait_for_confirmed(self): HEADERS_REQUEST_TOTAL_COUNT: "true", }, "params": status[i], - "verify": True, }, ), msg="GET method called incorrectly", @@ -140,63 +139,7 @@ def test_assets_wait_for_confirmed_timeout(self): RESPONSE_STORED, ], ), - MockResponse( - 200, - headers={HEADERS_TOTAL_COUNT: 2}, - assets=[ - RESPONSE_PENDING, - ], - ), - MockResponse( - 200, - headers={HEADERS_TOTAL_COUNT: 2}, - assets=[ - RESPONSE_STORED, - ], - ), - MockResponse( - 200, - headers={HEADERS_TOTAL_COUNT: 2}, - assets=[ - RESPONSE_PENDING, - ], - ), - MockResponse( - 200, - headers={HEADERS_TOTAL_COUNT: 2}, - assets=[ - RESPONSE_STORED, - ], - ), - MockResponse( - 200, - headers={HEADERS_TOTAL_COUNT: 2}, - assets=[ - RESPONSE_PENDING, - ], - ), - MockResponse( - 200, - headers={HEADERS_TOTAL_COUNT: 2}, - assets=[ - RESPONSE_STORED, - ], - ), - MockResponse( - 200, - headers={HEADERS_TOTAL_COUNT: 2}, - assets=[ - RESPONSE_PENDING, - ], - ), - MockResponse( - 200, - headers={HEADERS_TOTAL_COUNT: 2}, - assets=[ - RESPONSE_STORED, - ], - ), - ] + ] * 100 with self.assertRaises(ArchivistUnconfirmedError): self.arch.assets.wait_for_confirmed() @@ -234,5 +177,7 @@ def test_assets_wait_for_confirmed_failed(self): ), ] - with self.assertRaises(ArchivistUnconfirmedError): + with self.assertRaises( + ArchivistUnconfirmedError, msg="Failed to detect confirmation timeout" + ): self.arch.assets.wait_for_confirmed() diff --git a/unittests/testattachments.py b/unittests/testattachments.py index 5493d81a..a74082a9 100644 --- a/unittests/testattachments.py +++ b/unittests/testattachments.py @@ -215,8 +215,8 @@ def test_attachments_upload(self): msg="UPLOAD incorrect content-type", ) self.assertEqual( - kwargs["verify"], - True, + kwargs.get("verify"), + None, msg="UPLOAD method called incorrectly", ) self.assertEqual( @@ -304,7 +304,6 @@ def filedata(chunk_size=4096): # pylint: disable=unused-argument }, "params": expected_params, "stream": True, - "verify": True, }, msg="DOWNLOAD method called incorrectly", ) @@ -373,7 +372,6 @@ def test_attachments_info(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, msg="INFO method called incorrectly", ) diff --git a/unittests/testcompliance.py b/unittests/testcompliance.py index 3b2ed7c3..a3d9becc 100644 --- a/unittests/testcompliance.py +++ b/unittests/testcompliance.py @@ -132,7 +132,6 @@ def test_compliance(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, "params": None, }, ), diff --git a/unittests/testcompliance_policies.py b/unittests/testcompliance_policies.py index b9ae1d01..65ced53c 100644 --- a/unittests/testcompliance_policies.py +++ b/unittests/testcompliance_policies.py @@ -124,7 +124,6 @@ def test_compliance_policies_create(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -151,7 +150,6 @@ def test_compliance_policies_read(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -173,7 +171,6 @@ def test_compliance_policies_delete(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, ), msg="DELETE method called incorrectly", @@ -212,7 +209,6 @@ def test_compliance_policies_count(self): HEADERS_REQUEST_TOTAL_COUNT: "true", }, "params": {"page_size": 1}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -249,7 +245,6 @@ def test_compliance_policies_count_by_name(self): HEADERS_REQUEST_TOTAL_COUNT: "true", }, "params": {"page_size": 1, "compliance_type": "SINCE"}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -290,7 +285,6 @@ def test_compliance_policies_list(self): "authorization": "Bearer authauthauth", }, "params": {}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -335,7 +329,6 @@ def test_compliance_policies_list_by_name(self): "authorization": "Bearer authauthauth", }, "params": {"compliance_type": "SINCE"}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -369,7 +362,6 @@ def test_compliance_policies_read_by_signature(self): "authorization": "Bearer authauthauth", }, "params": {"page_size": 2}, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testevents.py b/unittests/testevents.py index 5f607c99..bbfd42ca 100644 --- a/unittests/testevents.py +++ b/unittests/testevents.py @@ -113,7 +113,6 @@ def test_events_read(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testeventscount.py b/unittests/testeventscount.py index b6404551..632f1c78 100644 --- a/unittests/testeventscount.py +++ b/unittests/testeventscount.py @@ -67,7 +67,6 @@ def test_events_count(self): HEADERS_REQUEST_TOTAL_COUNT: "true", }, "params": {"page_size": 1}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -108,7 +107,6 @@ def test_events_count_with_props_params(self): HEADERS_REQUEST_TOTAL_COUNT: "true", }, "params": {"page_size": 1, "confirmation_status": "CONFIRMED"}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -150,7 +148,6 @@ def test_events_count_with_attrs_params(self): "page_size": 1, "event_attributes.arc_firmware_version": "1.0", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -191,7 +188,6 @@ def test_events_count_with_wildcard_asset(self): "page_size": 1, "event_attributes.arc_firmware_version": "1.0", }, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testeventscreate.py b/unittests/testeventscreate.py index e862fedd..839958b7 100644 --- a/unittests/testeventscreate.py +++ b/unittests/testeventscreate.py @@ -91,7 +91,6 @@ def test_events_create(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -135,7 +134,6 @@ def test_events_create_with_upload_attachments(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -182,7 +180,6 @@ def test_events_create_with_upload_sbom_as_attachment(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -226,7 +223,6 @@ def test_events_create_with_location(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -267,7 +263,6 @@ def test_events_create_with_location_identity(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -310,7 +305,6 @@ def test_events_create_with_asset_attrs(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) diff --git a/unittests/testeventslist.py b/unittests/testeventslist.py index a6702846..2ed91667 100644 --- a/unittests/testeventslist.py +++ b/unittests/testeventslist.py @@ -71,7 +71,6 @@ def test_events_list(self): "authorization": "Bearer authauthauth", }, "params": {}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -129,7 +128,6 @@ def test_events_list_with_params(self): "confirmation_status": "CONFIRMED", "event_attributes.arc_firmware_version": "1.0", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -186,7 +184,6 @@ def test_events_list_with_wildcard_asset(self): "confirmation_status": "CONFIRMED", "event_attributes.arc_firmware_version": "1.0", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -226,7 +223,6 @@ def test_events_read_by_signature(self): "authorization": "Bearer authauthauth", }, "params": {"page_size": 2}, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testeventsread.py b/unittests/testeventsread.py index 8b82f399..ad524b06 100644 --- a/unittests/testeventsread.py +++ b/unittests/testeventsread.py @@ -56,7 +56,6 @@ def test_events_read(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testeventswait.py b/unittests/testeventswait.py index 86e9dad0..5fc613dc 100644 --- a/unittests/testeventswait.py +++ b/unittests/testeventswait.py @@ -88,7 +88,6 @@ def test_events_wait_for_confirmed(self): HEADERS_REQUEST_TOTAL_COUNT: "true", }, "params": status[i], - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testlocations.py b/unittests/testlocations.py index 5d06321a..ec302195 100644 --- a/unittests/testlocations.py +++ b/unittests/testlocations.py @@ -189,7 +189,6 @@ def test_locations_create(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -241,7 +240,6 @@ def test_locations_create_if_not_exists_existing_location(self): "display_name": "Macclesfield, Cheshire", "attributes.director": "John Smith", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -284,7 +282,6 @@ def test_locations_create_if_not_exists_nonexistent_location(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -328,7 +325,6 @@ def test_locations_create_if_not_exists_nonexistent_location_selector_noattribut "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -350,7 +346,6 @@ def test_locations_read(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -389,7 +384,6 @@ def test_locations_count(self): HEADERS_REQUEST_TOTAL_COUNT: "true", }, "params": {"page_size": 1}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -429,7 +423,6 @@ def test_locations_count_with_props_params(self): "page_size": 1, "display_name": "Macclesfield, Cheshire", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -464,7 +457,6 @@ def test_locations_count_with_attrs_params(self): "page_size": 1, "attributes.director": "John Smith", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -505,7 +497,6 @@ def test_locations_list(self): "authorization": "Bearer authauthauth", }, "params": {}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -554,7 +545,6 @@ def test_locations_list_with_params(self): "attributes.director": "John Smith", "display_name": "Macclesfield, Cheshire", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -588,7 +578,6 @@ def test_locations_read_by_signature(self): "authorization": "Bearer authauthauth", }, "params": {"page_size": 2}, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testpublicassetattachments.py b/unittests/testpublicassetattachments.py index 225c4765..646dd8b3 100644 --- a/unittests/testpublicassetattachments.py +++ b/unittests/testpublicassetattachments.py @@ -145,7 +145,6 @@ def filedata(chunk_size=4096): # pylint: disable=unused-argument "headers": {}, "params": expected_params, "stream": True, - "verify": True, }, msg="DOWNLOAD method called incorrectly", ) @@ -212,7 +211,6 @@ def test_assetattachments_info(self): { "headers": {}, "params": None, - "verify": True, }, msg="INFO method called incorrectly", ) diff --git a/unittests/testpublicassetsread.py b/unittests/testpublicassetsread.py index be07d648..4b3c37a1 100644 --- a/unittests/testpublicassetsread.py +++ b/unittests/testpublicassetsread.py @@ -65,7 +65,6 @@ def test_publicassets_read(self): kwargs, { "headers": {}, - "verify": True, "params": None, }, msg="GET method kwargs called incorrectly", diff --git a/unittests/testpublicevents.py b/unittests/testpublicevents.py index 676812be..1f1dfcf4 100644 --- a/unittests/testpublicevents.py +++ b/unittests/testpublicevents.py @@ -84,7 +84,6 @@ def test_publicevents_read(self): { "headers": {}, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -116,7 +115,6 @@ def test_publicevents_read_no_subpath(self): { "headers": {}, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -169,7 +167,6 @@ def test_publicevents_count(self): "event_attributes.arc_firmware_version": "1.0", "page_size": 1, }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -217,7 +214,6 @@ def test_publicevents_count_no_subpath(self): "event_attributes.arc_firmware_version": "1.0", "page_size": 1, }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -262,7 +258,6 @@ def test_publicevents_list(self): { "headers": {}, "params": {}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -307,7 +302,6 @@ def test_publicevents_list_no_subpath(self): { "headers": {}, "params": {}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -345,7 +339,6 @@ def test_publicevents_read_by_signature(self): { "headers": {}, "params": {"page_size": 2}, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testpublicget.py b/unittests/testpublicget.py index 3ca8444a..ad01052d 100644 --- a/unittests/testpublicget.py +++ b/unittests/testpublicget.py @@ -50,7 +50,6 @@ def test_get(self): { "headers": {}, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -94,7 +93,6 @@ def test_get_with_headers(self): "headerfield1": "headervalue1", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -156,7 +154,6 @@ def test_get_with_429_retry_and_success(self): { "headers": {}, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -203,7 +200,6 @@ def filedata(chunk_size=4096): # pylint: disable=unused-argument ("https://path/path/entity/xxxxxxxx",), { "headers": {}, - "verify": True, "stream": True, "params": None, }, @@ -294,7 +290,6 @@ def filedata(chunk_size=4096): # pylint: disable=unused-argument ("path/path/entity/xxxxxxxx",), { "headers": {}, - "verify": True, "stream": True, "params": None, }, diff --git a/unittests/testsubjects.py b/unittests/testsubjects.py index dfcab084..b546013e 100644 --- a/unittests/testsubjects.py +++ b/unittests/testsubjects.py @@ -139,7 +139,6 @@ def test_subjects_create(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -183,7 +182,6 @@ def test_subjects_share(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -205,7 +203,6 @@ def test_subjects_share(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -236,7 +233,6 @@ def test_subjects_import_subject(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -272,7 +268,6 @@ def test_subjects_create_from_b64(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="CREATE method kwargs called incorrectly", ) @@ -325,7 +320,6 @@ def test_subjects_read(self): "authorization": "Bearer authauthauth", }, "params": None, - "verify": True, }, ), msg="GET method called incorrectly", @@ -347,7 +341,6 @@ def test_subjects_delete(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, ), msg="DELETE method called incorrectly", @@ -377,7 +370,6 @@ def test_subjects_update(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="PATCH method kwargs called incorrectly", ) @@ -415,7 +407,6 @@ def test_subjects_count(self): HEADERS_REQUEST_TOTAL_COUNT: "true", }, "params": {"page_size": 1}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -455,7 +446,6 @@ def test_subjects_count_by_name(self): "page_size": 1, "display_name": "Subject display name", }, - "verify": True, }, ), msg="GET method called incorrectly", @@ -496,7 +486,6 @@ def test_subjects_list(self): "authorization": "Bearer authauthauth", }, "params": {}, - "verify": True, }, ), msg="GET method called incorrectly", @@ -541,7 +530,6 @@ def test_subjects_list_by_name(self): "authorization": "Bearer authauthauth", }, "params": {"display_name": "Subject display name"}, - "verify": True, }, ), msg="GET method called incorrectly", diff --git a/unittests/testtenancies.py b/unittests/testtenancies.py index e89295b7..a04510dc 100644 --- a/unittests/testtenancies.py +++ b/unittests/testtenancies.py @@ -85,7 +85,6 @@ def test_tenancies_publicinfo(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="GET method kwargs called incorrectly", ) @@ -116,7 +115,6 @@ def test_tenancies_publicinfo_response_identity(self): "headers": { "authorization": "Bearer authauthauth", }, - "verify": True, }, msg="GET method kwargs called incorrectly", )