CI / lint (pull_request) Successful in 1m24s
CI / test (3.12) (pull_request) Successful in 2m1s
CI / test (3.14) (pull_request) Successful in 4m11s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 2m5s
CI / coverage-analysis (pull_request) Canceled after 0s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Canceled after 2m14s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Canceled after 2m10s
CI / test-with-coverage (pull_request) Canceled after 2m9s
CI / test (3.13) (pull_request) Canceled after 2m15s
Docs build and publish / docker (push) Successful in 3s
CI / lint (push) Canceled after 38s
CI / test (3.12) (push) Canceled after 34s
CI / test (3.13) (push) Canceled after 33s
CI / test (3.14) (push) Canceled after 29s
CI / test-with-beamline-plugins (pxi_bec) (push) Canceled after 28s
CI / test-with-beamline-plugins (pxii_bec) (push) Canceled after 24s
CI / test-with-beamline-plugins (pxiii_bec) (push) Canceled after 23s
CI / test-with-coverage (push) Canceled after 19s
CI / coverage-analysis (push) Canceled after 0s
Build and Publish / release (push) Successful in 14s
46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
import importlib.util
|
|
from unittest.mock import MagicMock, patch
|
|
|
|
import pytest
|
|
from aarecommon.models.models import SampleShortInfo
|
|
|
|
from aare.beamline_dispatch.beamline_dispatch import get_beamline_dispatch
|
|
from aare.daq.daq import AareDAQ
|
|
|
|
|
|
@pytest.fixture()
|
|
def daq(mock_daq):
|
|
mock_daq.sync_current_sample_from_tell = MagicMock(
|
|
return_value=SampleShortInfo(
|
|
db_id=12345,
|
|
puck_name="T1",
|
|
pin=1,
|
|
dewar_name="TEST",
|
|
sample_name="test_sample",
|
|
run_number=42,
|
|
)
|
|
)
|
|
mock_daq.spreadsheet_params = MagicMock(return_value=(None, "/data/abcd/"))
|
|
mock_daq._cfg = MagicMock(auto_params=None)
|
|
return mock_daq
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
importlib.util.find_spec("pxii_bec") is None, reason="run only for pxii flavour"
|
|
)
|
|
def test_pxii_default_params(daq: AareDAQ):
|
|
with patch.dict("os.environ", {"BEAMLINE": "X10SA"}):
|
|
daq._dispatch = get_beamline_dispatch()
|
|
params = daq.get_collection_params(prefer_smart=False)[0]
|
|
assert params.transmission == 0.1
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
importlib.util.find_spec("pxiii_bec") is None, reason="run only for pxiii flavour"
|
|
)
|
|
def test_pxiii_default_params(daq: AareDAQ):
|
|
with patch.dict("os.environ", {"BEAMLINE": "X06DA"}):
|
|
daq._dispatch = get_beamline_dispatch()
|
|
params = daq.get_collection_params(prefer_smart=False)[0]
|
|
assert params.transmission == 1
|