예제 #1
0
 def test_is_newer_than(self):
     now = timeutil.utcnow()
     after = now + MINS_15
     self.assertFalse(timeutil.is_newer_than(after, timeutil.ONE_HOUR))
     after = now + MINS_30
     self.assertFalse(timeutil.is_newer_than(after, timeutil.ONE_HOUR))
     after = now + MINS_45
     self.assertFalse(timeutil.is_newer_than(after, timeutil.ONE_HOUR))
     after = now + ONE_HOUR
     self.assertTrue(timeutil.is_newer_than(after, timeutil.ONE_HOUR))
예제 #2
0
 def test_is_newer_than(self):
     now = timeutil.utcnow()
     after = now + MINS_15
     self.assertFalse(timeutil.is_newer_than(after, timeutil.ONE_HOUR))
     after = now + MINS_30
     self.assertFalse(timeutil.is_newer_than(after, timeutil.ONE_HOUR))
     after = now + MINS_45
     self.assertFalse(timeutil.is_newer_than(after, timeutil.ONE_HOUR))
     after = now + ONE_HOUR
     self.assertTrue(timeutil.is_newer_than(after, timeutil.ONE_HOUR))
예제 #3
0
파일: api.py 프로젝트: shad7/tvdbapi_client
 def token_expired(self):
     """Provide access to flag indicating if token has expired."""
     if self._token_timer is None:
         return True
     return timeutil.is_newer_than(self._token_timer, timeutil.ONE_HOUR)
예제 #4
0
파일: api.py 프로젝트: shad7/tvdbapi_client
 def token_expired(self):
     """Provide access to flag indicating if token has expired."""
     if self._token_timer is None:
         return True
     return timeutil.is_newer_than(self._token_timer, timeutil.ONE_HOUR)