Exemplo n.º 1
0
def test_row_table_object(mock_livestatus, register_builtin_html):
    live = mock_livestatus
    live.add_table(
        'hosts',
        [{
            'name': 'heute',
            'alias': 'heute',
            'host_state': 0,
            'host_has_been_checked': False,
        }],
    )
    live.expect_query('GET hosts\n'
                      'Columns: host_has_been_checked host_state name\n'
                      'Filter: name = heute')

    view_name = "hosts"
    view_spec = {
        "datasource": "hosts",
        "painters": [],
    }
    context = {
        'host': 'heute',
        'service': None,
    }
    view = View(view_name, view_spec, context)
    rt = RowTableLivestatus("hosts")

    with live(expect_status_query=True):
        rt.query(
            view=view,
            columns=['name'],
            headers='Filter: name = heute',
            only_sites=None,
            limit=None,
            all_active_filters=[],
        )
Exemplo n.º 2
0
 def table(self):
     return RowTableLivestatus("log")
Exemplo n.º 3
0
 def table(self):
     return RowTableLivestatus("servicegroups")
Exemplo n.º 4
0
 def table(self):
     return RowTableLivestatus("hostgroups")