Пример #1
0
def test_date_trigger_earlier():
    fire_date = datetime(2009, 7, 6)
    trigger = SimpleTrigger(fire_date)
    eq_(repr(trigger),
        "<SimpleTrigger (run_date=datetime.datetime(2009, 7, 6, 0, 0))>")
    eq_(str(trigger), "date[2009-07-06 00:00:00]")
    start_date = datetime(2008, 12, 1)
    eq_(trigger.get_next_fire_time(start_date), fire_date)
Пример #2
0
def test_date_trigger_text():
    trigger = SimpleTrigger('2009-7-6')
    start_date = datetime(2009, 7, 6)
    eq_(trigger.get_next_fire_time(start_date), datetime(2009, 7, 6))
Пример #3
0
def test_date_trigger_later():
    fire_date = datetime(2009, 7, 6)
    trigger = SimpleTrigger(fire_date)
    start_date = datetime(2009, 7, 7)
    eq_(trigger.get_next_fire_time(start_date), None)
Пример #4
0
def test_date_trigger_exact():
    fire_date = datetime(2009, 7, 6)
    trigger = SimpleTrigger(fire_date)
    start_date = datetime(2009, 7, 6)
    eq_(trigger.get_next_fire_time(start_date), fire_date)