1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
from datetime import datetime
from recurrence import Recurrence, Rule
import recurrence
def test_truthiness_with_single_rrule():
rule = Rule(
recurrence.DAILY
)
object = Recurrence(
rrules=[rule]
)
assert bool(object)
def test_truthiness_with_single_exrule():
rule = Rule(
recurrence.DAILY
)
object = Recurrence(
exrules=[rule]
)
assert bool(object)
def test_truthiness_with_single_rdate():
object = Recurrence(
rdates=[datetime(2014, 12, 31, 0, 0, 0)]
)
assert bool(object)
def test_truthiness_with_single_exdate():
object = Recurrence(
exdates=[datetime(2014, 12, 31, 0, 0, 0)]
)
assert bool(object)
def test_truthiness_with_dtstart():
object = Recurrence(
dtstart=datetime(2014, 12, 31, 0, 0, 0)
)
assert bool(object)
def test_truthiness_with_dtend():
object = Recurrence(
dtend=datetime(2014, 12, 31, 0, 0, 0)
)
assert bool(object)
def test_falsiness_with_empty_recurrence_object():
assert not bool(Recurrence())
|