Exemplo n.º 1
0
    async def test_ack_deadline_cache_cache_outdated_true(subscriber_client):
        cache = AckDeadlineCache(
            subscriber_client, 'fake_subscription', 0)
        cache.last_refresh = time.perf_counter()
        assert cache.cache_outdated()

        cache = AckDeadlineCache(
            subscriber_client, 'fake_subscription', 1000)
        cache.last_refresh = time.perf_counter()
        cache.ack_deadline = float('inf')
        assert cache.cache_outdated()
Exemplo n.º 2
0
 async def test_ack_deadline_cache_cache_outdated_false(subscriber_client):
     cache = AckDeadlineCache(
         subscriber_client, 'fake_subscription', 1000)
     cache.ack_deadline = 10
     cache.last_refresh = time.perf_counter()
     assert not cache.cache_outdated()