Esempio n. 1
0
def test_cycle_length():
    expected = 12 # number of months of cycle length

    descr1 = CycleDescription("month", expected)
    obs = ft.getCycleLength(descr1.attrs(), descr1.constrs())
    eq_(obs, expected)

    descr2 = CycleDescription("year", expected/12)
    obs = ft.getCycleLength(descr2.attrs(), descr2.constrs())
    assert_equal(obs, expected)

    cf = 80
    upval = (expected * 365 / 12) * (cf / 100.0)
    descr3 = CycleDescription("EFPD", upval, "percent", cf)
    obs = ft.getCycleLength(descr3.attrs(), descr3.constrs())
    assert_equal(obs, expected)
Esempio n. 2
0
def test_cycle_err():
    descr4 = CycleDescription("notaunit", 12)
    ft.getCycleLength(descr4.attrs(), descr4.constrs())