Coverage for tests/test_dummy_cs.py: 67%

1 import sys

2

3 from egse.process import SubProcess

4

5 from cgse_dummy.dummy_cs import DummyProxy

6

7

8 def test_start_dummy_cs():

9 print()

10

11 proc = SubProcess(

12 "Dummy CS", [sys.executable, "-m", "cgse_dummy.dummy_cs", "start"]

13 )

14 proc.execute()

15

16 with DummyProxy() as dummy:

17 assert dummy.info() == "DUMMY INSTRUMENTS, DAQ-1234, 0.0.2, SIMULATOR"

18 assert -180.0 <= dummy.get_value() <= 25.0

19 print(f"{dummy.get_value() = }")

20

21 proc.quit()