def test_candlepin_log():
    cp_log = CandlepinLog(context_wrap(CANDLEPIN_LOG))
    assert "req=49becd26-5dfe-4d2f-8667-470519230d88" in cp_log
    assert len(cp_log.get("req=bd5a4284-d280-4fc5-a3d5-fc976b7aa5cc")) == 2
    # https://github.com/RedHatInsights/insights-core/pull/2641
    # assert len(list(cp_log.get_after(datetime(2016, 9, 9, 13, 45, 53)))) == 2
    assert cp_log.get("req=bd5a4284-d280-4fc5-a3d5-fc976b7aa5cc")[0]['timestamp'] == datetime(2016, 9, 9, 13, 45, 52, 650000)
Exemple #2
0
def test_candlepin_log():
    cp_log = CandlepinLog(context_wrap(CANDLEPIN_LOG))
    assert "req=49becd26-5dfe-4d2f-8667-470519230d88" in cp_log
    assert len(cp_log.get("req=bd5a4284-d280-4fc5-a3d5-fc976b7aa5cc")) == 2
    assert len(list(cp_log.get_after(datetime(2016, 9, 9, 13, 45, 53)))) == 2