test: added test for static_device_test

This commit is contained in:
2024-01-26 17:54:03 +01:00
parent 257a316f6e
commit baac1ffe87
2 changed files with 14 additions and 2 deletions

View File

@ -18,7 +18,7 @@ except ImportError:
device_manager = None device_manager = None
class StaticDeviceTest: # pragma: no cover class StaticDeviceTest:
"""Class to perform tests on an ophyd device config file.""" """Class to perform tests on an ophyd device config file."""
def __init__(self, config: str, output_file: TextIOWrapper) -> None: def __init__(self, config: str, output_file: TextIOWrapper) -> None:
@ -293,7 +293,7 @@ def launch() -> None:
device_config_test.run(clargs.connect) device_config_test.run(clargs.connect)
if __name__ == "__main__": if __name__ == "__main__": # pragma: no cover
import sys import sys
sys.argv = ["", "--config", "../bec/bec_lib/bec_lib/configs/demo_config.yaml", "--connect"] sys.argv = ["", "--config", "../bec/bec_lib/bec_lib/configs/demo_config.yaml", "--connect"]

View File

@ -0,0 +1,12 @@
import os
import sys
import bec_lib
from ophyd_devices.utils.static_device_test import launch
def test_static_device_test():
config_path = os.path.join(os.path.dirname(bec_lib.__file__), "configs", "demo_config.yaml")
sys.argv = ["", "--config", config_path, "--connect"]
launch()