| Total Complexity | 5 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | """ |
||
| 8 | class DeprecationTests(unittest.TestCase): |
||
| 9 | def test_insecure_setup(self): |
||
| 10 | with warnings.catch_warnings(record=True) as w: |
||
| 11 | from flask import Flask |
||
| 12 | from flask_limiter import Limiter |
||
| 13 | app = Flask(__name__) |
||
| 14 | Limiter(app) |
||
| 15 | self.assertEqual(len(w), 1) |
||
| 16 | |||
| 17 | def test_with_global_limits(self): |
||
| 18 | with warnings.catch_warnings(record=True) as w: |
||
| 19 | from flask import Flask |
||
| 20 | from flask_limiter import Limiter |
||
| 21 | app = Flask(__name__) |
||
| 22 | Limiter(app, key_func=lambda x: 'test', global_limits=['1/second']) |
||
| 23 | self.assertEqual(len(w), 1) |
||
| 24 |