Пример #1
0
def test_get_rule_month(obj, expected):
    result = get_rule_month(obj)
    assert result == expected
Пример #2
0
def test_get_rule_month(obj, expected):
    result = get_rule_month(obj)
    assert result == expected
Пример #3
0
def test_get_rule_month():
    result = get_rule_month('W')
    assert (result == 'DEC')
    result = get_rule_month(offsets.Week())
    assert (result == 'DEC')

    result = get_rule_month('D')
    assert (result == 'DEC')
    result = get_rule_month(offsets.Day())
    assert (result == 'DEC')

    result = get_rule_month('Q')
    assert (result == 'DEC')
    result = get_rule_month(offsets.QuarterEnd(startingMonth=12))

    result = get_rule_month('Q-JAN')
    assert (result == 'JAN')
    result = get_rule_month(offsets.QuarterEnd(startingMonth=1))
    assert (result == 'JAN')

    result = get_rule_month('A-DEC')
    assert (result == 'DEC')
    result = get_rule_month('Y-DEC')
    assert (result == 'DEC')
    result = get_rule_month(offsets.YearEnd())
    assert (result == 'DEC')

    result = get_rule_month('A-MAY')
    assert (result == 'MAY')
    result = get_rule_month('Y-MAY')
    assert (result == 'MAY')
    result = get_rule_month(offsets.YearEnd(month=5))
    assert (result == 'MAY')
Пример #4
0
def test_get_rule_month():
    result = get_rule_month('W')
    assert (result == 'DEC')
    result = get_rule_month(offsets.Week())
    assert (result == 'DEC')

    result = get_rule_month('D')
    assert (result == 'DEC')
    result = get_rule_month(offsets.Day())
    assert (result == 'DEC')

    result = get_rule_month('Q')
    assert (result == 'DEC')
    result = get_rule_month(offsets.QuarterEnd(startingMonth=12))

    result = get_rule_month('Q-JAN')
    assert (result == 'JAN')
    result = get_rule_month(offsets.QuarterEnd(startingMonth=1))
    assert (result == 'JAN')

    result = get_rule_month('A-DEC')
    assert (result == 'DEC')
    result = get_rule_month('Y-DEC')
    assert (result == 'DEC')
    result = get_rule_month(offsets.YearEnd())
    assert (result == 'DEC')

    result = get_rule_month('A-MAY')
    assert (result == 'MAY')
    result = get_rule_month('Y-MAY')
    assert (result == 'MAY')
    result = get_rule_month(offsets.YearEnd(month=5))
    assert (result == 'MAY')