Example #1
0
 def test_multiple_keys(self):
     self._send_bad_attempts('test1', FLAGS.lockout_attempts)
     self.assertTrue(self._is_locked_out('test1'))
     self.assertFalse(self._is_locked_out('test2'))
     utils.advance_time_seconds(FLAGS.lockout_minutes * 60)
     self.assertFalse(self._is_locked_out('test1'))
     self.assertFalse(self._is_locked_out('test2'))
Example #2
0
 def test_window_timeout(self):
     self._send_bad_attempts('test', FLAGS.lockout_attempts - 1)
     self.assertFalse(self._is_locked_out('test'))
     utils.advance_time_seconds(FLAGS.lockout_window * 60)
     self._send_bad_attempts('test', FLAGS.lockout_attempts - 1)
     self.assertFalse(self._is_locked_out('test'))