STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
backend.test_run_config Namespace Reference

Functions

 elodin_dir (tmp_path, monkeypatch)
None snapshot (elodin_dir, str run_id, str text)
 labels (elodin_dir)
 test_sensor_role_names_raw_and_calibrated (labels)
 test_board_id_last_digit_is_the_elodin_slot (labels)
 test_slot_zero_means_ten ()
 test_actuator_role_names_sense_and_command_entities (labels)
 test_ball_valve_role_names_its_own_entities (elodin_dir)
 test_actuator_role_board_id_defaults_to_the_first_actuator_board (elodin_dir)
 test_actuator_role_wins_over_a_sensor_role_on_the_same_channel (elodin_dir)
 test_board_entities_are_keyed_by_board_id_not_slot (labels)
 test_self_test_entity_resolves_through_its_board (labels)
 test_unnamed_entities_get_no_label (labels)
 test_states_override_the_builtin_table_entry_by_entry (labels, elodin_dir)
 test_states_fall_back_to_the_builtin_table_with_no_snapshot ()
 test_engine_state_is_not_a_state_field ()
 test_missing_snapshot_degrades_to_numbers (elodin_dir)
 test_malformed_snapshot_does_not_raise (elodin_dir)
 test_annotate_stamps_labels_and_state_metadata (elodin_dir)
 test_annotate_reports_a_run_with_no_snapshot (elodin_dir)
 test_t7_channels_take_their_role_raw_and_calibrated (elodin_dir)
 test_t7_without_a_thermocouple_names_no_cold_junction (elodin_dir)

Variables

str CONFIG_TOML
str T7_TOML

Detailed Description

Unit tests for the per-run config snapshot → human names.

The entity spellings asserted here are the ones DatabaseConfig.cpp actually writes, and
the slot arithmetic is LoadActiveBoards' (`board_id % 10`, 0 → 10). If either moves, this
file is where the viewer finds out.

Run: cd webviewer && .venv/bin/python -m pytest backend/test_run_config.py -q

Function Documentation

◆ elodin_dir()

backend.test_run_config.elodin_dir ( tmp_path,
monkeypatch )

Definition at line 53 of file test_run_config.py.

◆ labels()

backend.test_run_config.labels ( elodin_dir)

Definition at line 63 of file test_run_config.py.

References snapshot().

◆ snapshot()

◆ test_actuator_role_board_id_defaults_to_the_first_actuator_board()

backend.test_run_config.test_actuator_role_board_id_defaults_to_the_first_actuator_board ( elodin_dir)

Definition at line 125 of file test_run_config.py.

References snapshot().

◆ test_actuator_role_names_sense_and_command_entities()

backend.test_run_config.test_actuator_role_names_sense_and_command_entities ( labels)

Definition at line 90 of file test_run_config.py.

◆ test_actuator_role_wins_over_a_sensor_role_on_the_same_channel()

backend.test_run_config.test_actuator_role_wins_over_a_sensor_role_on_the_same_channel ( elodin_dir)

Definition at line 137 of file test_run_config.py.

References snapshot().

◆ test_annotate_reports_a_run_with_no_snapshot()

backend.test_run_config.test_annotate_reports_a_run_with_no_snapshot ( elodin_dir)

Definition at line 221 of file test_run_config.py.

◆ test_annotate_stamps_labels_and_state_metadata()

backend.test_run_config.test_annotate_stamps_labels_and_state_metadata ( elodin_dir)

Definition at line 205 of file test_run_config.py.

References snapshot().

◆ test_ball_valve_role_names_its_own_entities()

backend.test_run_config.test_ball_valve_role_names_its_own_entities ( elodin_dir)

Definition at line 97 of file test_run_config.py.

References snapshot().

◆ test_board_entities_are_keyed_by_board_id_not_slot()

backend.test_run_config.test_board_entities_are_keyed_by_board_id_not_slot ( labels)

Definition at line 150 of file test_run_config.py.

◆ test_board_id_last_digit_is_the_elodin_slot()

backend.test_run_config.test_board_id_last_digit_is_the_elodin_slot ( labels)

Definition at line 77 of file test_run_config.py.

◆ test_engine_state_is_not_a_state_field()

backend.test_run_config.test_engine_state_is_not_a_state_field ( )

Definition at line 185 of file test_run_config.py.

◆ test_malformed_snapshot_does_not_raise()

backend.test_run_config.test_malformed_snapshot_does_not_raise ( elodin_dir)

Definition at line 199 of file test_run_config.py.

References snapshot().

◆ test_missing_snapshot_degrades_to_numbers()

backend.test_run_config.test_missing_snapshot_degrades_to_numbers ( elodin_dir)

Definition at line 194 of file test_run_config.py.

◆ test_self_test_entity_resolves_through_its_board()

backend.test_run_config.test_self_test_entity_resolves_through_its_board ( labels)

Definition at line 159 of file test_run_config.py.

◆ test_sensor_role_names_raw_and_calibrated()

backend.test_run_config.test_sensor_role_names_raw_and_calibrated ( labels)

Definition at line 71 of file test_run_config.py.

◆ test_slot_zero_means_ten()

backend.test_run_config.test_slot_zero_means_ten ( )

Definition at line 84 of file test_run_config.py.

◆ test_states_fall_back_to_the_builtin_table_with_no_snapshot()

backend.test_run_config.test_states_fall_back_to_the_builtin_table_with_no_snapshot ( )

Definition at line 180 of file test_run_config.py.

◆ test_states_override_the_builtin_table_entry_by_entry()

backend.test_run_config.test_states_override_the_builtin_table_entry_by_entry ( labels,
elodin_dir )

Definition at line 173 of file test_run_config.py.

◆ test_t7_channels_take_their_role_raw_and_calibrated()

backend.test_run_config.test_t7_channels_take_their_role_raw_and_calibrated ( elodin_dir)

Definition at line 258 of file test_run_config.py.

References snapshot().

◆ test_t7_without_a_thermocouple_names_no_cold_junction()

backend.test_run_config.test_t7_without_a_thermocouple_names_no_cold_junction ( elodin_dir)

Definition at line 274 of file test_run_config.py.

References snapshot().

◆ test_unnamed_entities_get_no_label()

backend.test_run_config.test_unnamed_entities_get_no_label ( labels)

Definition at line 164 of file test_run_config.py.

Variable Documentation

◆ CONFIG_TOML

str backend.test_run_config.CONFIG_TOML

Definition at line 15 of file test_run_config.py.

◆ T7_TOML

str backend.test_run_config.T7_TOML
Initial value:
1= """
2[boards.pt_board]
3type = "PT"
4board_id = 21
5
6[sensor_roles_pt_board]
7"Ox Upstream" = 5
8
9[boards.labjack_1]
10type = "T7"
11board_id = 82
12
13[[boards.labjack_1.channels]]
14ain = 1
15kind = "PT"
16role = "LOX Tank"
17
18[[boards.labjack_1.channels]]
19ain = 2
20kind = "TC"
21role = "Nozzle TC"
22tc_type = "K"
23
24[[boards.labjack_1.channels]]
25ain = 6
26kind = "VOLTAGE"
27"""

Definition at line 229 of file test_run_config.py.