Skip to content

Commit

Permalink
Added validation tests for month and day of week names replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrmsn committed May 29, 2023
1 parent 33686d0 commit 6128dca
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/test_valid_regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,32 @@ def test_validator_day_of_week_part():
assert_validate_successfully("* * * * */6")
assert_validate_fail("* * * * */0")
assert_validate_fail("* * * * */7")


def test_validator_month_names():
assert_validate_successfully("* * * jan *")
assert_validate_successfully("* * * FEB,mar,Apr *")
assert_validate_successfully("* * * MAY-JUL *")
assert_validate_successfully("* * * jun-Aug *")
assert_validate_successfully("* * * Sep,Oct *")
assert_validate_successfully("* * * dec/3 *")
assert_validate_fail("* * * January *")
assert_validate_fail("* * * jan1 *")
assert_validate_fail("* * * 1jan *")
assert_validate_fail("* * * 2/feb *")
assert_validate_fail("* * * */feb *")
assert_validate_fail("* * * NOV/0 *")


def test_validator_day_of_week_names():
assert_validate_successfully("* * * * sun")
assert_validate_successfully("* * * * mon,TUE,Wed")
assert_validate_successfully("* * * * FRI-SAT")
assert_validate_successfully("* * * * wed/2")
assert_validate_fail("* * * * Sunday")
assert_validate_fail("* * * * sun,mon-fri")
assert_validate_fail("* * * * tue/0")
assert_validate_fail("* * * * */mon")
assert_validate_fail("* * * * 1/wed")
assert_validate_fail("* * * * mon/mon")

0 comments on commit 6128dca

Please sign in to comment.