def test_is_expired_with_tz(self): offset = datetime.timedelta(seconds=5) self.assertTrue( s3_utils.is_expired(datetime.datetime.now(tz=pytz.timezone("EST")) - offset) ) self.assertFalse( s3_utils.is_expired(datetime.datetime.now(tz=pytz.timezone("EST")) + offset) )
def test_is_expired_with_tz(self): offset = datetime.timedelta(seconds=5) assert s3_utils.is_expired(datetime.datetime.now(tz=pytz.timezone("EST")) - offset) assert not s3_utils.is_expired(datetime.datetime.now(tz=pytz.timezone("EST")) + offset)
def test_is_expired(self): offset = datetime.timedelta(seconds=5) self.assertTrue(s3_utils.is_expired(datetime.datetime.now() - offset)) self.assertFalse(s3_utils.is_expired(datetime.datetime.now() + offset))
def test_is_expired(self): offset = datetime.timedelta(seconds=5) assert s3_utils.is_expired(datetime.datetime.now() - offset) assert not s3_utils.is_expired(datetime.datetime.now() + offset)