STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_gse_actuators.py
Go to the documentation of this file.
1"""The GSE side of a bottle the drawing does not fill.
2
3Its charge and dump are the state table's own actuators, `GSE High Press
4Control` and `GSE High Press Vent`: the one place the session names an actuator
5itself, because that side has no valve on the drawing for the hookup to bind.
6Renamed or dropped from the CSV, the built-in charge and dump stopped without a
7word; now the notes say which row is missing and what no state can do.
8"""
9
10from __future__ import annotations
11
12from dataclasses import replace
13
14from test_press_path_coupling import _helium_stand
15
16
17def _without(session, *names): # type: ignore[no-untyped-def]
18 machine = session.machine
19 kept = tuple(a for a in machine.actuators if a not in names)
20 session.machine = replace(machine, actuators=kept)
21
22
24 session = _helium_stand()
25 assert not any("no state can" in n for n in session._notes())
26
27
29 session = _helium_stand()
30 _without(session, "GSE High Press Control")
31 (said,) = [n for n in session._notes() if "no state can" in n]
32 assert "'GSE High Press Control'" in said and said.endswith("can charge it.")
33
34
36 session = _helium_stand()
37 _without(session, "GSE High Press Control", "GSE High Press Vent")
38 (said,) = [n for n in session._notes() if "no state can" in n]
39 assert "'GSE High Press Vent'" in said and said.endswith("charge or dump it.")
None test_a_table_that_cannot_charge_an_undrawn_bottle_says_so()
_without(session, *names)
None test_a_table_with_both_rows_says_nothing()
None test_and_one_that_can_neither_charge_nor_dump_it_says_both()