Exemplo n.º 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)
Exemplo n.º 2
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)
Exemplo n.º 3
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))
Exemplo n.º 4
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)
Exemplo n.º 5
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)
Exemplo n.º 6
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))
Exemplo n.º 7
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)
Exemplo n.º 8
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)