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

TestStr2Dt.test_title_returns_invalid()   A

Complexity

Conditions 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
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