File: power_example.py

package info (click to toggle)
labgrid 25.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,796 kB
  • sloc: python: 21,352; sh: 846; makefile: 35
file content (18 lines) | stat: -rw-r--r-- 337 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pytest


@pytest.fixture()
def pdu(target):
    return target.get_driver("NetworkPowerDriver")


def test_something(pdu):
    pdu.on()
    # Note that the pdu might not have switched on when requesting it's
    # status immediately
    assert pdu.get() is True

    # ... do something

    pdu.off()
    assert pdu.get() is False