Add weekly periodic schedule to AccessTime param type.

Fix bug #588414
This commit is contained in:
root 2010-05-04 14:12:55 -04:00 committed by Rob Crittenden
parent 3ea044fb59
commit a3d1b17559
2 changed files with 4 additions and 3 deletions

View File

@ -1525,6 +1525,8 @@ class AccessTime(Str):
index = self._check_Y_spec(ts, 2)
elif ts[1] == 'monthly':
index = self._check_M_spec(ts, 2)
elif ts[1] == 'weekly':
index = self._check_W_spec(ts, 2)
elif ts[1] == 'daily':
index = 1
if index is None:

View File

@ -1372,19 +1372,18 @@ class test_AccessTime(ClassChecker):
for value in (u'absolute 201012161032 ~ 201012161033',
u'periodic monthly week 2 day Sat,Sun 0900-1300',
u'periodic yearly month 4 day 1-31 0800-1400',
u'periodic weekly day 7 0800-1400',
u'periodic daily 0800-1400',
):
assert rule(dummy, value) is None
assert dummy.called() is False
# FIXME, weekly is not implemented in AccessTime
# u'periodic weekly day 8 0800-1400',
# And some bad ones
for value in (u'absolute 201012161032 - 201012161033',
u'absolute 201012161032 ~',
u'periodic monthly day Sat,Sun 0900-1300',
u'periodical yearly month 4 day 1-31 0800-1400',
u'periodic weekly day 8 0800-1400',
):
e = raises(ValidationError, o._rule_required, None, value)