コード例 #1
0
ファイル: test_relay.py プロジェクト: munnik/ShipControl
 def test_set_state(self):
     relay_group = RelayGroup(2)
     relay0 = Relay('relay0', relay_group, 0)
     relay1 = Relay('relay1', relay_group, 1)
     assert relay0.state == Relay.OPEN
     assert relay1.state == Relay.OPEN
     relay0.state = Relay.CLOSED
     assert relay0.state == Relay.CLOSED
     assert relay1.state == Relay.OPEN
     relay1.state = Relay.CLOSED
     assert relay0.state == Relay.CLOSED
     assert relay1.state == Relay.CLOSED