Files
appleb_m 6f44da0078
Build and Publish / test (push) Failing after 1m4s
Build and Publish / build (push) Has been skipped
Build and Publish / Build and Deploy Docs (push) Has been skipped
tests: added tests for aerotech, models, autofocus, automation, beamline, diffraction_geometry, enum_pv, face_detection_find_xtal, jfjoch_client, mlbox, my_motor, spreadsheet_updater and worfkflows
2026-04-28 14:35:54 +02:00

22 lines
726 B
Python

import os
import pytest
from unittest.mock import patch
from aare.common.beamline import mx_beamline, MXBeamline
def test_mx_beamline_default():
with patch.dict(os.environ, {}, clear=True):
# If BEAMLINE is not set, it should return SIMULATED
assert mx_beamline() == MXBeamline.SIMULATED
def test_mx_beamline_x10sa():
with patch.dict(os.environ, {"BEAMLINE": "x10sa"}):
assert mx_beamline() == MXBeamline.X10SA
def test_mx_beamline_x06sa():
with patch.dict(os.environ, {"BEAMLINE": "X06SA "}):
assert mx_beamline() == MXBeamline.X06SA
def test_mx_beamline_invalid():
with patch.dict(os.environ, {"BEAMLINE": "INVALID"}):
assert mx_beamline() == MXBeamline.SIMULATED