File: test_aodevice.py

package info (click to toggle)
python-pyepics 3.5.7%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,336 kB
  • sloc: python: 10,539; makefile: 112; javascript: 104; sh: 53
file content (20 lines) | stat: -rw-r--r-- 451 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/python

# test of simplest device

from epics.devices import ao
import sys
import time
from epics.utils import IOENCODING

def test_aodevice():
    myao = ao('PyTest:ao1')
    assert len(myao._pvs) > 10
    assert myao.VAL is not None
    myao.write_state('tmp_aostate.txt')

    time.sleep(0.5)
    flines = []
    with open('tmp_aostate.txt', encoding=IOENCODING) as fh:
        flines.extend( fh.readlines())
    assert len(flines) > 10