Ejemplo n.º 1
0
def test_multiple_hosts(hosts, fact_scans, get, user, monkeypatch_jsonbfield_get_db_prep_save):
    epoch = timezone.now()

    (host, response) = setup_common(hosts, fact_scans, get, user, epoch=epoch, host_count=3)
    facts_known = Fact.get_timeline(host.id)
    assert 9 == len(facts_known)
    assert 9 == len(response.data['results'])

    for i, fact_known in enumerate(facts_known):
        check_url(response.data['results'][i]['related']['fact_view'], fact_known, fact_known.module)
Ejemplo n.º 2
0
def test_param_to(hosts, fact_scans, get, user, monkeypatch_jsonbfield_get_db_prep_save):
    epoch = timezone.now()
    search = {
        'to': epoch + timedelta(days=1),
    }

    (host, response) = setup_common(hosts, fact_scans, get, user, epoch=epoch, get_params=search)
    facts_known = Fact.get_timeline(host.id, ts_to=search['to'])
    assert 6 == len(facts_known)
    assert 6 == len(response.data['results'])

    check_response_facts(facts_known, response)
Ejemplo n.º 3
0
def test_param_module(hosts, fact_scans, get, user, monkeypatch_jsonbfield_get_db_prep_save):
    epoch = timezone.now()
    search = {
        'module': 'packages',
    }

    (host, response) = setup_common(hosts, fact_scans, get, user, epoch=epoch, get_params=search)
    facts_known = Fact.get_timeline(host.id, module=search['module'])
    assert 3 == len(facts_known)
    assert 3 == len(response.data['results'])

    check_response_facts(facts_known, response)