1.1 --- a/tests/qualifiers.py Mon Jun 05 18:42:20 2017 +0200
1.2 +++ b/tests/qualifiers.py Tue Jun 06 00:02:05 2017 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Test qualifiers for recurring events.
1.6
1.7 -Copyright (C) 2014, 2015 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2014, 2015, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -772,4 +772,36 @@
1.13 print l[-1] == (1998, 3, 30, 9, 0, 0), (1998, 3, 30, 9, 0, 0), l[-1]
1.14 print
1.15
1.16 +qualifiers = get_qualifiers(["FREQ=MONTHLY", "BYMONTHDAY=5", "FREQ=HOURLY", "INTERVAL=12"])
1.17 +
1.18 +l = order_qualifiers(qualifiers)
1.19 +show(l)
1.20 +dt = (2017, 6, 13)
1.21 +l = get_datetime_structure(dt)
1.22 +show(l)
1.23 +l = combine_datetime_with_qualifiers(dt, qualifiers)
1.24 +show(l)
1.25 +
1.26 +s = get_selector(dt, qualifiers)
1.27 +l = s.materialise(dt, (2019, 1, 1))
1.28 +print len(l) == 36
1.29 +print l[0] == (2017, 7, 5, 0), (2017, 7, 5, 0), l[0]
1.30 +print l[-1] == (2018, 12, 5, 12), (2018, 12, 5, 12), l[-1]
1.31 +
1.32 +qualifiers = get_qualifiers(["FREQ=DAILY", "BYMONTH=1"])
1.33 +
1.34 +l = order_qualifiers(qualifiers)
1.35 +show(l)
1.36 +dt = (2017, 6, 13)
1.37 +l = get_datetime_structure(dt)
1.38 +show(l)
1.39 +l = combine_datetime_with_qualifiers(dt, qualifiers)
1.40 +show(l)
1.41 +
1.42 +s = get_selector(dt, qualifiers)
1.43 +l = s.materialise(dt, (2019, 1, 1))
1.44 +print len(l) == 31
1.45 +print l[0] == (2018, 1, 1), (2018, 1, 1), l[0]
1.46 +print l[-1] == (2018, 1, 31), (2018, 1, 31), l[-1]
1.47 +
1.48 # vim: tabstop=4 expandtab shiftwidth=4