+ assert int(p["when"]) >= when, "checking track played at right time"
+ assert c.schedule_list() == [], "checking schedule is empty"
+ wait_idle(c)
+ print " scheduling an enable-random for the future"
+ c.schedule_add(now() + 3, "junk", "set-global", "random-play", "yes")
+ print " disorder schedule-list output:"
+ print string.join(dtest.command(["disorder",
+ "--config", disorder._configfile,
+ "--no-per-user-config",
+ "schedule-list"]), ""),
+ next_playing(c)
+ print " disabling random play"
+ c.random_disable()
+ wait_idle(c)
+ print " scheduling track to play later via command line"
+ when = now() + 3
+ dtest.command(["disorder",
+ "--config", disorder._configfile,
+ "--no-per-user-config",
+ "schedule-play",
+ time.strftime("%Y-%m-%d %H:%M:%S",
+ time.localtime(when)),
+ "normal",
+ track])
+ print " disorder schedule-list output:"
+ print string.join(dtest.command(["disorder",
+ "--config", disorder._configfile,
+ "--no-per-user-config",
+ "schedule-list"]), ""),
+ p = next_playing(c)
+ assert p["track"] == track, "checking right track played"
+ assert p["when"] >= when, "checking track played at right time"
+ assert c.schedule_list() == [], "checking schedule is empty"
+ wait_idle(c)
+ print " scheduling an enable-random for later via command line"
+ dtest.command(["disorder",
+ "--config", disorder._configfile,
+ "--no-per-user-config",
+ "schedule-set-global",
+ time.strftime("%Y-%m-%d %H:%M:%S",
+ time.localtime(now() + 3)),
+ "normal",
+ "random-play",
+ "yes"])
+ print " disorder schedule-list output:"
+ print string.join(dtest.command(["disorder",
+ "--config", disorder._configfile,
+ "--no-per-user-config",
+ "schedule-list"]), ""),
+ p = next_playing(c)
+ print " disabling random play"
+ c.random_disable()