-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #988 from spc-group/undulator
Wrote new support for the planar undulator.
- Loading branch information
Showing
3 changed files
with
90 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import pytest | ||
from ophyd.sim import instantiate_fake_device | ||
|
||
from ..aps_undulator import PlanarUndulator | ||
|
||
|
||
@pytest.fixture() | ||
def undulator(): | ||
undulator = instantiate_fake_device(PlanarUndulator, prefix="PSS:255ID:", name="undulator") | ||
return undulator | ||
|
||
|
||
def test_set_energy(undulator): | ||
assert undulator.start_button.get() == 0 | ||
undulator.energy.set(5) | ||
assert undulator.energy.setpoint.get() == 5 | ||
assert undulator.start_button.get() == 1 | ||
|
||
|
||
def test_stop_energy(undulator): | ||
assert undulator.stop_button.get() == 0 | ||
undulator.stop() | ||
assert undulator.stop_button.get() == 1 |