From 44a9ac52292d93fe417931e631782079cbba540c Mon Sep 17 00:00:00 2001 From: Joshua Hiller Date: Mon, 29 Jan 2024 21:32:44 -0500 Subject: [PATCH] Skip unsupported SSL unit test on usgov1 --- tests/test_service_class.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/test_service_class.py b/tests/test_service_class.py index 7e884bcb9..dafc44a0c 100644 --- a/tests/test_service_class.py +++ b/tests/test_service_class.py @@ -376,18 +376,21 @@ def test_list_response_component_get_property(self): @rate_limited @not_supported def test_list_response_component_get_property_fail(self): - with pytest.warns(SSLDisabledWarning): - _no_ssl = Hosts(creds=config.creds, pythonic=True, debug=_DEBUG, ssl_verify=False) - if _no_ssl.token_status == 403: - pytest.skip("SSL required for GovCloud testing.") - try: - if _no_ssl.token_valid and not _no_ssl.token_stale: # Duplicative, just testing the properties - _thing: Result = _no_ssl.query_devices(limit=3) - except APIError: - pytest.skip("SSL required for GovCloud testing.") - position = 5 _success = False + if config.base_url != "https://api.laggar.gcw.crowdstrike.com": + with pytest.warns(SSLDisabledWarning): + _no_ssl = Hosts(creds=config.creds, pythonic=True, debug=_DEBUG, ssl_verify=False) + if _no_ssl.token_status == 403: + pytest.skip("SSL required for GovCloud testing.") + try: + if _no_ssl.token_valid and not _no_ssl.token_stale: # Duplicative, just testing the properties + _thing: Result = _no_ssl.query_devices(limit=3) + except APIError: + pytest.skip("SSL required for GovCloud testing.") + else: + pytest.skip("This test is unsupported in this region.") + try: _success = bool(_thing.resources.get_property(position)) except IndexError: