Skip to content

Commit

Permalink
[get_client_test] Fix UT (#4833)
Browse files Browse the repository at this point in the history
* [get_client_test] Fix UT

* Add changelog
  • Loading branch information
mmhw authored Feb 25, 2025
1 parent 7233c10 commit 16fe31e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
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

0 comments on commit 16fe31e

Please sign in to comment.