DeprecationTests.test_with_global_limits()   A
last analyzed

Complexity

Conditions 3

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
1
"""
2
3
"""
4
import unittest
5
import warnings
6
7
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