diff --git a/tests/test_service_class.py b/tests/test_service_class.py index 23c691c0b..7e884bcb9 100644 --- a/tests/test_service_class.py +++ b/tests/test_service_class.py @@ -114,13 +114,22 @@ def test_log_setup(self): @not_supported def test_property_debug_record_count(self): global _CLEAN - _CLEAN = Hosts(creds=config.creds, user_agent="clean/1.0", timeout=120, proxy={}) + _CLEAN = Hosts(creds=config.creds, user_agent="clean/1.0", timeout=120, proxy={}, base_url=config.base_url) if _CLEAN.token_status == 429: global _RATE_LIMITED _RATE_LIMITED = True assert bool(_CLEAN.debug_record_count) + @rate_limited + @not_supported + def test_service_class_context_manager(self): + _success = False + with _CLEAN as sdk: + if sdk.query_devices()["status_code"] == 200: + _success = True + assert _success + @rate_limited @not_supported def test_property_refreshable(self): @@ -193,6 +202,7 @@ def test_disable_ssl_verify_dynamic(self): _CLEAN.ssl_verify = False assert bool(not _CLEAN.ssl_verify) + @rate_limited @not_supported def test_property_base_service_class_proxy(self): diff --git a/tests/test_spotlight_vulnerabilities.py b/tests/test_spotlight_vulnerabilities.py index 426ae15b2..fd29a3189 100644 --- a/tests/test_spotlight_vulnerabilities.py +++ b/tests/test_spotlight_vulnerabilities.py @@ -20,11 +20,13 @@ class TestSpotlight: def spotlight_queryVulnerabilities(self): - if falcon.queryVulnerabilities( - parameters={"limit": 1, - "filter": "created_timestamp:>'2021-01-01T00:00:01Z'" - } - )["status_code"] in AllowedResponses: + result = falcon.queryVulnerabilities(parameters={"limit": 1, + "filter": "created_timestamp:>'2021-01-01T00:00:01Z'" + }, + pythonic=True + ) + if result.status_code in AllowedResponses: + _ = result.after return True else: return False @@ -69,6 +71,9 @@ def spotlight_GenerateErrors(self): errorChecks = False return errorChecks + @pytest.mark.skipif(config.base_url == "https://api.laggar.gcw.crowdstrike.com", + reason="Unit testing unavailable on US-GOV-1" + ) def test_queryVulnerabilities(self): assert self.spotlight_queryVulnerabilities() is True diff --git a/tests/test_uber.py b/tests/test_uber.py index d6d9f4055..c905bca31 100644 --- a/tests/test_uber.py +++ b/tests/test_uber.py @@ -45,6 +45,13 @@ class TestUber: + def test_uber_context_manager(self): + _success = False + with falcon as sdk: + if sdk.command("QueryDevicesByFilterScroll")["status_code"] == 200: + _success = True + assert _success + def uberCCAWS_GetAWSSettings(self): returned = False authenticated = falcon.authenticated() @@ -388,3 +395,4 @@ def test_pythonic_failure(self): except APIError: _success = True assert _success +