summaryrefslogtreecommitdiff
path: root/validation/test/test_av_avln/test_io_group.py
blob: f5d76d889b4972ffb0f91e18931ca4976cb75b94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- coding: utf-8 -*-

"""Module allowing to validate that the groups of io's are correctly configured
and can be controlled"""

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"