-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding setting of ndattributes_file XML to the Xspress3Detector staging.
- Loading branch information
1 parent
66b42af
commit 97f87d9
Showing
3 changed files
with
62 additions
and
22 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import asyncio | ||
import xml.etree.ElementTree as ET | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
@@ -80,6 +81,22 @@ async def test_ndattribute_params(): | |
assert len(params) == n_elem * n_params | ||
|
||
|
||
async def test_stage_ndattributes(detector): | ||
num_elem = 8 | ||
set_mock_value(detector.drv.number_of_elements, num_elem) | ||
set_mock_value(detector.drv.nd_attributes_file, "XSP3.xml") | ||
await detector.stage() | ||
xml_mock = get_mock_put(detector.drv.nd_attributes_file) | ||
assert xml_mock.called | ||
# Test that the XML is correct | ||
args, kwargs = xml_mock.call_args | ||
tree = ET.fromstring(args[0]) | ||
assert len(tree) == num_elem * 9 | ||
# Check that the XML file gets reset when unstaged | ||
await detector.unstage() | ||
assert xml_mock.call_args[0][0] == "XSP3.xml" | ||
|
||
|
||
# ----------------------------------------------------------------------------- | ||
# :author: Mark Wolfman | ||
# :email: [email protected] | ||
|