# -*- coding: utf-8 -*- import validlib.power_strip as power_strip def test(): print "Executing", __file__, "..." test_power_strip_control() def test_power_strip_control(): subindexes = power_strip.subindexes() for index in power_strip.indexes(): power_strip.switch("off", (index, subindexes)) for subindex in subindexes: key = (index, subindex) assert power_strip.status(key) == "off" power_strip.switch("on", key) assert power_strip.status(key) == "on" print "OK: The power plug", key, "can be controlled" print "OK: The power strip", index, "can be controlled"