X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/067eeb5f497179a9edbfe83bc7f1fb790dd2a9cc..0e464e60978139f24c27ad22bd2a89329a06697c:/tests/schedule.py diff --git a/tests/schedule.py b/tests/schedule.py index ac0b438..fe3c5c3 100755 --- a/tests/schedule.py +++ b/tests/schedule.py @@ -172,7 +172,29 @@ 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() + print " dumping database" + dump = "%s/dumpfile" % dtest.testroot + print dtest.command(["disorder-dump", "--config", disorder._configfile, + "--dump", dump]) + print "restoring database" + print dtest.command(["disorder-dump", "--config", disorder._configfile, + "--undump", dump]) + 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()