예제 #1
0
def test_live_tail_api(mocked_url, mocked_handle_tail, mocked_generate_headers):
    setup_httpretty()

    mocked_url.return_value = '', MOCK_API_URL
    httpretty.register_uri(httpretty.POST, MOCK_API_URL, content_type='application/json',
                           body=json.dumps({}))

    api.tail_logs(logkeys=str(uuid.uuid4()), leql=None, poll_interval=0.5)

    assert mocked_generate_headers.called
    assert mocked_handle_tail.called

    teardown_httpretty()
예제 #2
0
def test_live_tail_api(mocked_url, mocked_handle_tail,
                       mocked_generate_headers):
    setup_httpretty()

    mocked_url.return_value = '', MOCK_API_URL
    httpretty.register_uri(httpretty.POST,
                           MOCK_API_URL,
                           content_type='application/json',
                           body=json.dumps({}))

    api.tail_logs(logkeys=str(uuid.uuid4()), leql=None, poll_interval=0.5)

    assert mocked_generate_headers.called
    assert mocked_handle_tail.called

    teardown_httpretty()
예제 #3
0
def tail_events(logkeys, favorites, logset, leql, poll_interval, saved_query):
    """Tail events of given logkey(s) with provided options"""
    success = api.tail_logs(logkeys, leql, poll_interval, favorites, logset,
                            saved_query)

    if not success:
        click.echo(
            "Example usage: lecli tail events 12345678-aaaa-bbbb-1234-1234cb123456"
        )