X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/067eeb5f497179a9edbfe83bc7f1fb790dd2a9cc..99bd6109fe37c4cacd1fefe40db7e196e1e94c82:/tests/schedule.py 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()