Ejemplo n.º 1
0
def test_serialization_cloudwatch_logs_insights_target():
    """Serializing a graph doesn't explode."""
    graph = G.Logs(title="Lambda Duration",
                   dataSource="Cloudwatch data source",
                   targets=[
                       C.CloudwatchLogsInsightsTarget(),
                   ],
                   id=1,
                   wrapLogMessages=True)
    stream = StringIO()
    _gen.write_dashboard(graph, stream)
    assert stream.getvalue() != ''
Ejemplo n.º 2
0
def test_logs_panel():
    data_source = 'dummy data source'
    targets = ['dummy_prom_query']
    title = 'dummy title'
    logs = G.Logs(data_source, targets, title)
    data = logs.to_json_data()
    assert data['targets'] == targets
    assert data['datasource'] == data_source
    assert data['title'] == title
    assert data['options']['showLabels'] is False
    assert data['options']['showTime'] is False
    assert data['options']['wrapLogMessage'] is False
    assert data['options']['sortOrder'] == 'Descending'
Ejemplo n.º 3
0
def test_logs_panel():
    data_source = 'dummy data source'
    targets = ['dummy_prom_query']
    title = 'dummy title'
    logs = G.Logs(data_source, targets, title)
    data = logs.to_json_data()
    assert data['targets'] == targets
    assert data['datasource'] == data_source
    assert data['title'] == title
    assert data['options']['showLabels'] is False
    assert data['options']['showCommonLabels'] is False
    assert data['options']['showTime'] is False
    assert data['options']['wrapLogMessage'] is False
    assert data['options']['sortOrder'] == 'Descending'
    assert data['options']['dedupStrategy'] == 'none'
    assert data['options']['enableLogDetails'] is False
    assert data['options']['prettifyLogMessage'] is False