TestBs3Col   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 11

2 Methods

Rating   Name   Duplication   Size   Complexity  
B test_returns_right_width() 0 8 7
A test_returns_right_width_bad_data() 0 5 4
1
"""Tests for 'layout' filters."""
2
3
from flask_extras.filters import layout
4
5
6
class TestBs3Col:
7
    """All tests for bs3 col function."""
8
9
    def test_returns_right_width(self):
10
        """Test the return value for a valid type."""
11
        assert layout.bs3_cols(1) == 12
12
        assert layout.bs3_cols(2) == 6
13
        assert layout.bs3_cols(3) == 4
14
        assert layout.bs3_cols(4) == 3
15
        assert layout.bs3_cols(5) == 2
16
        assert layout.bs3_cols(6) == 2
17
18
    def test_returns_right_width_bad_data(self):
19
        """Test the return value for an invalid type."""
20
        assert layout.bs3_cols(None) == 12
21
        assert layout.bs3_cols('foo') == 12
22
        assert layout.bs3_cols(dict()) == 12
23