Пример #1
0
def test_event_container():
    container = EventContainer("test", {})
    container.set_owner("testowner")
    container.set_fingerprint("testfp")
    container.set_metadata({"a": "b"})

    record = container.get_record()
    assert record.owner == "testowner"
    assert record.fingerprint == "testfp"
    assert "a" in record.event_metadata
Пример #2
0
def test_event_container():
    container = EventContainer('test', {})
    container.set_owner('testowner')
    container.set_fingerprint('testfp')
    container.set_metadata({'a': 'b'})

    record = container.get_record()
    assert record.owner == 'testowner'
    assert record.fingerprint == 'testfp'
    assert 'a' in record.event_metadata
Пример #3
0
def messages() -> List[EventContainer]:
    """Get all test messages and their filenames as an iterator.

    Returns:
        EventContainer: some test event
    """
    event = EventContainer("test", {})
    event.set_owner("*****@*****.**")
    event.set_fingerprint("test")
    return [event]
Пример #4
0
def get_all_test_messages(parsed=False):
    """Get all test messages and their filenames as an iterator.

    Args:
        parsed (bool): returns Event objects if true otherwise strings
    Yields:
        EventContainer: some test event
    """
    event = EventContainer("test", {})
    event.set_owner("*****@*****.**")
    event.set_fingerprint("test")
    return [event]