Example #1
0
def test_tolerant():
    aiofluent.sender.setup("tag", host="myhost", port=24225, timeout=1.0)
    actual = aiofluent.sender.get_global_sender()
    assert actual._tag == "tag"
    assert actual._host == "myhost"
    assert actual._port == 24225
    assert actual._timeout == 1.0

    from aiofluent.sender import _set_global_sender
    _set_global_sender(None)
Example #2
0
def test_no_kwargs():
    aiofluent.sender.setup("tag")
    actual = aiofluent.sender.get_global_sender()
    assert actual._tag == "tag"
    assert actual._host == "localhost"
    assert actual._port == 24224
    assert actual._timeout == 3

    from aiofluent.sender import _set_global_sender
    _set_global_sender(None)
Example #3
0
def test_sender(mock_server):
    sender.setup('app', connection_factory=mock_server.factory)
    yield sender
    sender.close()
    sender._set_global_sender(None)