Skip to content

Commit

Permalink
TST #68 general fourc test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Dec 26, 2020
1 parent 26233b0 commit db2b4c4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions hkl/tests/class_fourc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import pytest
from ophyd import Component as Cpt
from ophyd import (PseudoSingle, SoftPositioner)

import gi
gi.require_version('Hkl', '5.0')
# NOTE: MUST call gi.require_version() BEFORE import hkl
from hkl.diffract import E4CV


class Fourc(E4CV):
h = Cpt(PseudoSingle, '')
k = Cpt(PseudoSingle, '')
l = Cpt(PseudoSingle, '')

omega = Cpt(SoftPositioner)
chi = Cpt(SoftPositioner)
phi = Cpt(SoftPositioner)
tth = Cpt(SoftPositioner)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

for p in self.real_positioners:
p._set_position(0) # give each a starting position


@pytest.fixture(scope='function')
def fourc():
fourc = Fourc('', name='fourc')
fourc.wait_for_connection()
# fourc._update_calc_energy()
return fourc

0 comments on commit db2b4c4

Please sign in to comment.