Exemplo n.º 1
0
def test_query_row_table_inventory_history_add_columns(monkeypatch):
    row_table = inventory.RowTableInventoryHistory()
    view = View("", {}, {})
    monkeypatch.setattr(row_table, "_get_raw_data", lambda only_sites, query: RAW_ROWS2)
    monkeypatch.setattr(row_table, "_get_inv_data", lambda hostrow: INV_HIST_ROWS)
    rows, _len_rows = row_table.query(view, ['host_foo'], "", None, None, [])
    for row in rows:
        assert set(row) == set(EXPECTED_INV_HIST_KEYS + ['host_foo'])
Exemplo n.º 2
0
def test_query_row_table_inventory_history_unknown_columns(monkeypatch):
    row_table = inventory.RowTableInventoryHistory()
    monkeypatch.setattr(row_table, "_get_raw_data",
                        lambda only_sites, query: RAW_ROWS)
    monkeypatch.setattr(row_table, "_get_inv_data",
                        lambda hostrow: INV_HIST_ROWS)
    rows, len_rows = row_table.query(None, ['foo'], None, None, None, [])
    for row in rows:
        assert set(row) == set(EXPECTED_INV_HIST_KEYS)