1.1 --- a/tests/test_recurrence.py Sun Jul 14 21:11:12 2013 +0200
1.2 +++ b/tests/test_recurrence.py Mon Jul 15 00:00:00 2013 +0200
1.3 @@ -7,50 +7,98 @@
1.4 s = "every single day of 2013"
1.5 print s
1.6 print "->", getRecurrence(s)
1.7 +
1.8 s = "every Tuesday of 2013"
1.9 print s
1.10 print "->", getRecurrence(s)
1.11 +
1.12 s = "every Wednesday of every March"
1.13 print s
1.14 print "->", getRecurrence(s)
1.15 -s = "every single day of every other February from 2013"
1.16 +
1.17 +s = "every single day of every other February from 2013-02"
1.18 print s
1.19 print "->", getRecurrence(s)
1.20 -s = "every single day of every other February from 2013-02-01"
1.21 -print s
1.22 -print "->", getRecurrence(s)
1.23 +
1.24 s = "every other day from 2013-02-01"
1.25 print s
1.26 print "->", getRecurrence(s)
1.27 -s = "every single day of the second month"
1.28 +
1.29 +s = "every single day of the second month of 2013"
1.30 print s
1.31 print "->", getRecurrence(s)
1.32 +
1.33 +s = "every single day of the second month in 2013"
1.34 +print s
1.35 +print "->", getRecurrence(s)
1.36 +
1.37 s = "every single day of the second month of every year"
1.38 print s
1.39 print "->", getRecurrence(s)
1.40 +
1.41 s = "every other day from the first day of every other month from the third month of every year"
1.42 print s
1.43 print "->", getRecurrence(s)
1.44 -s = "the second day of every other month from the first month"
1.45 +
1.46 +s = "the second day of every other month from the first month of 2012"
1.47 print s
1.48 print "->", getRecurrence(s)
1.49 +
1.50 s = "the second hour in the second day in the second month of every year"
1.51 print s
1.52 print "->", getRecurrence(s)
1.53 +
1.54 s = "every day from the second day until the 10th day of every other month until the fifth month"
1.55 print s
1.56 print "->", getRecurrence(s)
1.57 +
1.58 s = "every day from the 10th day in the second month until the 10th day in the 10th month of every third month from the first month"
1.59 print s
1.60 print "->", getRecurrence(s)
1.61 -s = "every day of every third month from the 10th day in the second month until the 10th day in the 10th month"
1.62 -print s
1.63 -print "->", getRecurrence(s)
1.64
1.65 # Bad recurrences.
1.66
1.67 print
1.68
1.69 +# Incomplete specification.
1.70 +
1.71 +s = "every single day of the second month"
1.72 +print s
1.73 +try:
1.74 + print "->", getRecurrence(s)
1.75 +except ParseError, exc:
1.76 + print exc
1.77 +
1.78 +s = "the second day of every other month from the first month"
1.79 +print s
1.80 +try:
1.81 + print "->", getRecurrence(s)
1.82 +except ParseError, exc:
1.83 + print exc
1.84 +
1.85 +# Limits do not match recurrence.
1.86 +
1.87 +s = "every single day of every other February from 2013"
1.88 +print s
1.89 +try:
1.90 + print "->", getRecurrence(s)
1.91 +except ParseError, exc:
1.92 + print exc
1.93 +
1.94 +s = "every single day of every other February from 2013-02-01"
1.95 +print s
1.96 +try:
1.97 + print "->", getRecurrence(s)
1.98 +except ParseError, exc:
1.99 + print exc
1.100 +
1.101 +s = "every day of every third month from the 10th day in the second month until the 10th day in the 10th month"
1.102 +print s
1.103 +try:
1.104 + print "->", getRecurrence(s)
1.105 +except ParseError, exc:
1.106 + print exc
1.107 +
1.108 # No start or end points.
1.109
1.110 s = "every other day of every other month"