# -*- coding: utf-8 -*- import validlib.io_group as io_group def test(): print "Executing", __file__, "..." test_io_group_control() def test_io_group_control(): subindexes = io_group.subindexes() for index in io_group.indexes(): io_group.switch("off", (index, subindexes)) for subindex in subindexes: key = (index, subindex) assert io_group.status(key) == "off" io_group.switch("on", key) assert io_group.status(key) == "on" print "OK: The io", key, "can be controlled" print "OK: The group of io's", index, "can be controlled"