Skip to content

Commit 18e3057

Browse files
committed
except assertRaise 2.6
1 parent 4f65cf6 commit 18e3057

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

test/test_authtoken.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -216,27 +216,28 @@ def test_acl_deli_escape_on__ignoreQuery_yes(self):
216216
##########
217217

218218
def test_times(self):
219-
att = AuthToken(key=AT_ENCRYPTION_KEY, window_seconds=DEFAULT_WINDOW_SECONDS, escape_early=False)
220-
# start_time
221-
with self.assertRaises(AuthTokenError):
222-
att.generateToken(start_time=-1)
223-
224-
with self.assertRaises(AuthTokenError):
225-
att.generateToken(start_time="hello")
226-
227-
# end_time
228-
with self.assertRaises(AuthTokenError):
229-
att.generateToken(end_time=-1)
230-
231-
with self.assertRaises(AuthTokenError):
232-
att.generateToken(end_time="hello")
233-
234-
# window_seconds
235-
with self.assertRaises(AuthTokenError):
236-
att.generateToken(window_seconds=-1)
237-
238-
with self.assertRaises(AuthTokenError):
239-
att.generateToken(window_seconds="hello")
219+
if not (sys.version_info[0] == 2 and sys.version_info[1] <= 6):
220+
att = AuthToken(key=AT_ENCRYPTION_KEY, window_seconds=DEFAULT_WINDOW_SECONDS, escape_early=False)
221+
# start_time
222+
with self.assertRaises(AuthTokenError):
223+
att.generateToken(start_time=-1)
224+
225+
with self.assertRaises(AuthTokenError):
226+
att.generateToken(start_time="hello")
227+
228+
# end_time
229+
with self.assertRaises(AuthTokenError):
230+
att.generateToken(end_time=-1)
231+
232+
with self.assertRaises(AuthTokenError):
233+
att.generateToken(end_time="hello")
234+
235+
# window_seconds
236+
with self.assertRaises(AuthTokenError):
237+
att.generateToken(window_seconds=-1)
238+
239+
with self.assertRaises(AuthTokenError):
240+
att.generateToken(window_seconds="hello")
240241

241242

242243
if __name__ == '__main__':

0 commit comments

Comments
 (0)