Skip to content

Commit

Permalink
Expand unit testing to complete code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jshcodes committed Nov 20, 2023
1 parent 19d5828 commit 89a48a0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
11 changes: 11 additions & 0 deletions tests/test_service_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ def test_property_debug_record_count(self):

assert bool(_CLEAN.debug_record_count)

@rate_limited
@not_supported
def test_service_class_context_manager(self):
_success = False
with _CLEAN as sdk:
print(sdk.query_devices())
if sdk.query_devices()["status_code"] == 200:
_success = True
assert _success

@rate_limited
@not_supported
def test_property_refreshable(self):
Expand Down Expand Up @@ -193,6 +203,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):
Expand Down
12 changes: 7 additions & 5 deletions tests/test_spotlight_vulnerabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tests/test_uber.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -388,3 +395,4 @@ def test_pythonic_failure(self):
except APIError:
_success = True
assert _success

0 comments on commit 89a48a0

Please sign in to comment.