def expire_at_test(self):
     'should set an expiration timestamp on an activity feed.'
     self.add_items_to_feed('david', Leaderboard.DEFAULT_PAGE_SIZE)
     t = datetime.datetime.now() + datetime.timedelta(seconds=10)
     self.a.expire_at('david', datetime_to_timestamp(t))
     ttl = self.a.redis.ttl(self.a.feed_key('david'))
     self.assertEqual(1 < ttl <= 10, True)
Example #2
0
 def expire_at_test(self):
     'should set an expiration timestamp on an activity feed.'
     self.add_items_to_feed('david',
                            leaderboard.Leaderboard.DEFAULT_PAGE_SIZE)
     t = datetime.datetime.now() + datetime.timedelta(seconds=10)
     self.a.expire_at('david', datetime_to_timestamp(t))
     ttl = self.a.redis.ttl(self.a.feed_key('david'))
     self.assertEqual(1 < ttl <= 10, True)
Example #3
0
def timestamp_utcnow():
    return datetime_to_timestamp(utcnow())
Example #4
0
def timestamp(*args):
    return datetime_to_timestamp(datetime.datetime(*args))
Example #5
0
def timestamp_utcnow():
    return datetime_to_timestamp(utcnow())
Example #6
0
def timestamp(*args):
    return datetime_to_timestamp(datetime.datetime(*args))