Skip to content

Commit

Permalink
Merge pull request #34 from FiniteStateInc/cp/asoc-fix-tests
Browse files Browse the repository at this point in the history
Fix failing tests
  • Loading branch information
cpfarherFinitestate authored Aug 27, 2024
2 parents f9cfb9b + 8b9b976 commit 5b81405
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/test_update_finding_statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class TestUpdateFindingStatuses:
token = "mock_token"
organization_context = "mock_organization_context"
user_id = "mock_user_id"
finding_ids = ["mock_finding_id_1", "mock_finding_id_2"]
finding_id = ["mock_finding_id_1", "mock_finding_id_2"]
status = "AFFECTED"

@patch("finite_state_sdk.send_graphql_query")
Expand All @@ -17,7 +17,7 @@ def test_update_finding_statuses_success(self, mock_send_graphql_query):
mock_send_graphql_query.return_value = mock_response

# Call the function
result = update_finding_statuses(self.token, self.organization_context, self.user_id, self.finding_ids, self.status)
result = update_finding_statuses(self.token, self.organization_context, self.user_id, self.finding_id, self.status)

# Assertions
mock_send_graphql_query.assert_called_once()
Expand All @@ -26,7 +26,7 @@ def test_update_finding_statuses_success(self, mock_send_graphql_query):

@pytest.mark.parametrize(
"missing_param",
[("user_id", None), ("finding_ids", None), ("status", None)]
[("user_id", None), ("finding_id", None), ("status", None)]
)
def test_update_finding_statuses_missing_params(self, missing_param):
# Unpack missing parameter
Expand All @@ -37,9 +37,9 @@ def test_update_finding_statuses_missing_params(self, missing_param):
update_finding_statuses(
self.token, self.organization_context,
self.user_id if param_name != "user_id" else param_value,
self.finding_ids if param_name != "finding_ids" else param_value,
self.finding_id if param_name != "finding_id" else param_value,
self.status if param_name != "status" else param_value
)

# Assertion
assert str(excinfo.value) == f"{param_name.replace('_', ' ').title()} is required"
assert str(excinfo.value).lower() == f"{param_name.replace('_', ' ').title()} is required".lower()
2 changes: 1 addition & 1 deletion tests/test_upload_file_for_binary_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ def test_upload_file_for_binary_analysis_missing_params(self, missing_param):
)

# Assertion
assert str(excinfo.value) == f"{param_name.replace('_', ' ').title()} is required"
assert str(excinfo.value).lower() == f"{param_name.replace('_', ' ').title()} is required".lower()

0 comments on commit 5b81405

Please sign in to comment.