Beispiel #1
0
def test_should_update_event_with_info_id_without_deleting_meta_info(
    given_any_info_id, given_any_event_dict_with_meta, given_any_meta_dict
):

    event = Event.from_dict(given_any_event_dict_with_meta)
    assert event.event_meta == given_any_meta_dict

    event.add_info_id(given_any_info_id)

    expected_event_dict = {"info_id": given_any_info_id.to_dict()}
    expected_event_dict.update(given_any_meta_dict)
    assert event.to_dict()["data"]["meta"] == expected_event_dict
def assert_recorded_events(base_url):
    wait_for_event()

    response_events = requests.get(f"{base_url}/events")
    assert response_events.status_code == 200
    events = response_events.json().get("events")
    event_names = [Event.from_dict(event).event_name for event in events]

    expected_event_names = [
        "service.deployed",
        "task.created",
        "task.retrieved",
        "task.created",
        "task.removed",
    ]
    assert sorted(expected_event_names) == sorted(event_names)