Mercurial > p > roundup > code
comparison test/test_config.py @ 5772:8dbe307bdb57
Finish up login rate limit code. Set config item to 0 disables, make
sure config item can't be negative integer.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 07 Jun 2019 13:50:57 -0400 |
| parents | f91da208f26b |
| children | 765f8c0e99ef |
comparison
equal
deleted
inserted
replaced
| 5771:3f00269f3297 | 5772:8dbe307bdb57 |
|---|---|
| 66 config._get_option('TRACKER_WEB').set, "htt://foo.example/bar/") | 66 config._get_option('TRACKER_WEB').set, "htt://foo.example/bar/") |
| 67 | 67 |
| 68 self.assertRaises(configuration.OptionValueError, | 68 self.assertRaises(configuration.OptionValueError, |
| 69 config._get_option('TRACKER_WEB').set, "htt://foo.example/bar") | 69 config._get_option('TRACKER_WEB').set, "htt://foo.example/bar") |
| 70 | 70 |
| 71 def testLoginRateLimit(self): | |
| 72 config = configuration.CoreConfig() | |
| 73 | |
| 74 self.assertEqual(None, | |
| 75 config._get_option('WEB_LOGIN_ATTEMPTS_MIN').set("0")) | |
| 76 self.assertEqual(None, | |
| 77 config._get_option('WEB_LOGIN_ATTEMPTS_MIN').set("200")) | |
| 78 | |
| 79 self.assertRaises(configuration.OptionValueError, | |
| 80 config._get_option('WEB_LOGIN_ATTEMPTS_MIN').set, "fred") | |
| 81 | |
| 82 self.assertRaises(configuration.OptionValueError, | |
| 83 config._get_option('WEB_LOGIN_ATTEMPTS_MIN').set, "-1") | |
| 84 |
