DeprecationTests   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 16
rs 10
wmc 5

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_insecure_setup() 0 7 2
A test_with_global_limits() 0 7 3
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