aboutsummaryrefslogtreecommitdiff
path: root/tests/filters/test_dateedit.py
blob: 5191b26402c6ce74003e9c2f4bd41308a0d113b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import pytest

import resumejson_converter.filters as filters


def test_dateedit_only_one_parameter():
    with pytest.raises(TypeError):
        filters.dateedit()


def test_dateedit_only_one_parameter():
    with pytest.raises(TypeError):
        filters.dateedit("2019-01-01")


def test_dateedit_false_date():
    with pytest.raises(ValueError):
        filters.dateedit("2019-01-01i", "")


def test_dateedit_only_start_date():
    assert filters.dateedit("2019-01-01", "") == "2019 - Auj."


def test_dateedite_same_year():
    assert filters.dateedit("2019-01-01", "2019-02-02") == "2019"


def test_dateedit_start_date_and_end_date_different():
    assert filters.dateedit("2019-01-01", "2017-05-01") == "2019 - 2017"