Skip to content

Commit

Permalink
test: Add new test to cover custom intake URL
Browse files Browse the repository at this point in the history
  • Loading branch information
otetard committed Mar 29, 2024
1 parent c996264 commit 78f7fb1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/connectors/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def test_push_event_to_intake_with_chunks(test_connector, mocked_trigger_logs):
def test_push_event_to_intake_custom_url(
test_connector, mocked_trigger_logs, config_storage
):
assert test_connector.configuration.intake_server is None

url = "https://fra2.app.sekoia.io/v1/intake-http/batch"
batch_mock = mocked_trigger_logs.post(
url, json={"event_ids": ["001"]}, additional_matcher=match_events("foo")
Expand All @@ -162,6 +164,21 @@ def test_push_event_to_intake_custom_url(
assert batch_mock.call_count == 1


def test_push_event_to_intake_custom_url_configuration(
test_connector, mocked_trigger_logs
):
url = "https://fra2.app.sekoia.io/v1/intake-http/batch"
batch_mock = mocked_trigger_logs.post(
url, json={"event_ids": ["001"]}, additional_matcher=match_events("foo")
)

test_connector.configuration.intake_server = (
"https://fra2.app.sekoia.io/v1/intake-http"
)
test_connector.push_events_to_intakes(["foo"])
assert batch_mock.call_count == 1


def test_push_event_to_intake_with_chunks_executor_stopped(
test_connector, mocked_trigger_logs
):
Expand Down

0 comments on commit 78f7fb1

Please sign in to comment.