From: Richard Kettlewell Date: Sat, 24 May 2008 18:42:07 +0000 (+0100) Subject: more schedule testing X-Git-Tag: 4.0~65^2~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/99bd6109fe37c4cacd1fefe40db7e196e1e94c82 more schedule testing --- diff --git a/tests/schedule.py b/tests/schedule.py index ac0b438..178871f 100755 --- a/tests/schedule.py +++ b/tests/schedule.py @@ -172,7 +172,22 @@ def test(): assert False, "checking schedule_add failed" except disorder.operationError: pass # good - + print " checking scheduled events survive restarts" + c.schedule_add(now + 4, "normal", "play", track) + dtest.stop_daemon() + dtest.start_daemon() + c = disorder.client() + print " waiting for track to play" + waited = 0 + p = c.playing() + while p is None and waited < 10: + time.sleep(1) + print " ." + waited += 1 + p = c.playing() + assert waited < 10, "checking track played within a reasonable period" + assert p["track"] == track, "checking right track played" + assert c.schedule_list() == [], "checking schedule is empty" if __name__ == '__main__': dtest.run()