Test Failed
Push — master ( 3b2725...be4dc6 )
by Chris
01:25
created

TestStr2Dt   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_title_returns_valid() 0 5 2
A test_title_returns_invalid() 0 4 2
1
"""Test munging filters."""
2
3
from dateutil.parser import parse as dtparse
4
5
from flask_extras.filters import datetimes
6
7
import pytest
8
9
10
class TestStr2Dt:
11
    """All tests for str2dt function."""
12
13
    def test_title_returns_valid(self):
14
        """Test function."""
15
        timestr = '01-05-1900 00:00:00'
16
        res = datetimes.str2dt(timestr)
17
        assert res == dtparse(timestr) == res
18
19
    def test_title_returns_invalid(self):
20
        """Test function."""
21
        with pytest.raises(TypeError):
22
            datetimes.str2dt(None)
23