Skip to content

Commit

Permalink
Skip unsupported SSL unit test on usgov1
Browse files Browse the repository at this point in the history
  • Loading branch information
jshcodes committed Jan 31, 2024
1 parent cf11bf1 commit 44a9ac5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions tests/test_service_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 44a9ac5

Please sign in to comment.