Fix _is_expired_token issues (#47)

This commit is contained in:
SearchDream
2017-11-17 15:59:33 +03:00
committed by Sergey Petrov
parent c272fa8bf2
commit bbe8528acf
4 changed files with 15 additions and 10 deletions
+10 -6
View File
@@ -6,6 +6,8 @@
from unittest import TestCase, main
from freezegun import freeze_time
import time
from apns2.credentials import TokenCredentials
@@ -28,12 +30,14 @@ class TokenCredentialsTestCase(TestCase):
self.team_id)
self.lasting_header = self.normal_creds.get_authorization_header(
self.topics[0])
self.expiring_creds = \
TokenCredentials(self.key_path, self.key_id,
self.team_id,
token_lifetime=self.token_lifetime)
self.expiring_header = self.expiring_creds.get_authorization_header(
self.topics[0])
with freeze_time('2012-01-14'):
self.expiring_creds = \
TokenCredentials(self.key_path, self.key_id,
self.team_id,
token_lifetime=self.token_lifetime)
self.expiring_header = self.expiring_creds.get_authorization_header(
self.topics[0])
def test_create_multiple_topics(self):
h1 = self.normal_creds.get_authorization_header(self.topics[0])