def test_create_event():
    event = helpers.create_test_event()
    fetched_event = event_manager.get_event(event.id)
    assert fetched_event is not None
    assert fetched_event.id == event.id

    helpers.cleanup(event.id)
def test_update_event_severity():
    event = helpers.create_test_event()
    assert event.event_severity is None
    event_manager.update_event_severity(event.id, 5)
    fetched_event = event_manager.get_event(event.id)
    assert fetched_event.event_severity == 5

    helpers.cleanup(event.id)
def test_update_event_duration():
    event = helpers.create_test_event()
    assert event.event_duration is None
    event_manager.update_event_duration(event.id, "1-3")
    fetched_event = event_manager.get_event(event.id)
    assert fetched_event.event_duration == "1-3"

    helpers.cleanup(event.id)
def test_update_event_type():
    event = helpers.create_test_event()
    assert event.event_type is None
    event_manager.update_event_type(event.id, AURA_EVENT_TYPE)
    fetched_event = event_manager.get_event(event.id)
    assert fetched_event.event_type == AURA_EVENT_TYPE

    helpers.cleanup(event.id)
def test_delete_event():
    event = helpers.create_test_event()
    fetched_event = event_manager.get_event(event.id)
    assert fetched_event is not None
    event_manager.delete_event(event.id)
    fetched_event = event_manager.get_event(event.id)
    assert fetched_event is None

    helpers.cleanup(event.id)
def test_update_event_tracking_status():
    event = helpers.create_test_event()
    assert event.event_tracking_status_name == 'CREATED'

    event_manager.update_event_type(event.id, AURA_EVENT_TYPE)
    event_manager.update_event_tracking_status(event.id)
    fetched_event = event_manager.get_event(event.id)
    assert fetched_event.event_tracking_status_name == 'PARTIALLY_COMPLETE'

    event_manager.update_event_severity(event.id, 4)
    event_manager.update_event_tracking_status(event.id)
    fetched_event = event_manager.get_event(event.id)
    assert fetched_event.event_tracking_status_name == 'PARTIALLY_COMPLETE'

    event_manager.update_event_duration(event.id, 80)
    event_manager.update_event_tracking_status(event.id)
    fetched_event = event_manager.get_event(event.id)
    assert fetched_event.event_tracking_status_name == 'COMPLETE'

    helpers.cleanup(event.id)