single dow
This commit is contained in:
parent
cf87e73cd5
commit
a862fe3e1e
1 changed files with 21 additions and 0 deletions
|
@ -51,6 +51,16 @@ def onehour_sunday(request):
|
|||
})
|
||||
|
||||
|
||||
@pytest.fixture(params=[1, 2, 3, 4, 5, 6, 7])
|
||||
def singledow(request):
|
||||
weekday = request.param
|
||||
yield FrequencyAlarm({
|
||||
'interval': 3600*24,
|
||||
'weekdays': [weekday],
|
||||
'start': 0
|
||||
})
|
||||
|
||||
|
||||
@pytest.fixture(params=['seconds', 'human', 'coloned'])
|
||||
def tenseconds(now, request):
|
||||
'''a FrequencyAlarm: every 10 seconds for one day'''
|
||||
|
@ -172,6 +182,17 @@ def test_long_interval(manyweeks):
|
|||
assert manyweeks.next_ring(got) is not None
|
||||
|
||||
|
||||
def test_singledow(singledow):
|
||||
t = datetime.fromtimestamp(1)
|
||||
got = singledow.next_ring(t)
|
||||
wd = singledow.weekdays[0]
|
||||
assert got is not None
|
||||
assert got.isoweekday() == wd
|
||||
|
||||
assert singledow.next_ring(got) is not None
|
||||
assert singledow.next_ring(got).isoweekday() == wd
|
||||
|
||||
|
||||
def test_single_registered():
|
||||
timegenerate({
|
||||
'kind': 'single',
|
||||
|
|
Loading…
Reference in a new issue