Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[get_client_test] Fix UT #4833

Merged
merged 3 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changelog/4833.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Fixed an issue where some unit-tests failed in github-actions CI.
type: internal
pr_number: 4833
12 changes: 8 additions & 4 deletions demisto_sdk/commands/common/clients/tests/get_client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def _xsoar_generic_request_side_effect(
)


def test_get_client_from_server_type_base_url_is_not_api_url(mocker):
def test_get_client_from_server_type_base_url_is_not_api_url(mocker, requests_mock):
"""
Given:
- /ioc-rules endpoint that is not valid
Expand All @@ -300,11 +300,15 @@ def _xsoar_generic_request_side_effect(
mocker.patch.object(
DefaultApi, "generic_request", side_effect=_xsoar_generic_request_side_effect
)
base_url = "https://test5.com"
requests_mock.get(
f"{base_url}/public_api/v1/healthcheck",
json={"status": "available"},
status_code=200,
)

with pytest.raises(ValueError):
get_client_from_server_type(
base_url="https://test5.com", api_key="test", auth_id="1"
)
get_client_from_server_type(base_url=base_url, api_key="test", auth_id="1")


@pytest.mark.parametrize(
Expand Down