'Test case for https://github.com/aio-libs/aiohttp/issues/2084'

def test_cookie_not_expired_when_added_after_removal(self):

    timestamps = [533588.993, 533588.993, 533588.993, 533588.993, 533589.093, 533589.093]
    loop = mock.Mock()
    loop.time.side_effect = itertools.chain(timestamps, itertools.cycle([timestamps[(-1)]]))
    jar = CookieJar(unsafe=True, loop=loop)
    jar.update_cookies(SimpleCookie('foo="";    Max-Age=0'))
    jar.update_cookies(SimpleCookie('foo="bar"'))
    assert (len(jar) == 1)
