mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-06-13 23:07:15 +02:00
test: added test for static_device_test
This commit is contained in:
@ -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"]
|
||||||
|
12
tests/test_static_device_test.py
Normal file
12
tests/test_static_device_test.py
Normal 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()
|
Reference in New Issue
Block a user