def test_get_fetch_times(mocker, mock_past, mock_now, expected):
    from ProofpointTAP_v2 import get_fetch_times
    mocker.patch('ProofpointTAP_v2.get_now',
                 return_value=datetime.strptime(mock_now,
                                                "%Y-%m-%dT%H:%M:%SZ"))
    times = get_fetch_times(mock_past)
    assert len(times) == expected
def test_get_fetch_times():
    from datetime import datetime, timedelta
    from ProofpointTAP_v2 import get_fetch_times

    now = datetime.now()
    before_two_hours = now - timedelta(hours=2)
    times = get_fetch_times(before_two_hours)
    assert len(times) == 3