Extract index switch policy
This commit is contained in:
@@ -36,6 +36,7 @@ import formatter_input # noqa: E402
|
||||
import hardcore_position_config # noqa: E402
|
||||
import __init__ as sxcp_nodes # noqa: E402
|
||||
import generation_profile_config # noqa: E402
|
||||
import index_switch_policy # noqa: E402
|
||||
import krea_cast # noqa: E402
|
||||
import krea_formatter # noqa: E402
|
||||
import location_config # noqa: E402
|
||||
@@ -2647,6 +2648,22 @@ def smoke_node_utility_registration() -> None:
|
||||
|
||||
|
||||
def smoke_server_route_payload_policy() -> None:
|
||||
requested, selected, available = index_switch_policy.input_selection(
|
||||
0,
|
||||
"zero_based",
|
||||
"fallback",
|
||||
{"input_1": "first"},
|
||||
)
|
||||
_expect((requested, selected, available) == (1, 1, [1]), "Index switch policy zero-based selection changed")
|
||||
_expect(
|
||||
index_switch_policy.route_selection(65, "one_based", "wrap") == (65, 1),
|
||||
"Index switch policy wrap routing changed",
|
||||
)
|
||||
_expect(
|
||||
index_switch_policy.lazy_inputs(2, "pick_input", "one_based", "fallback", {"input_2": "second"}) == ["input_2"],
|
||||
"Index switch policy lazy input selection changed",
|
||||
)
|
||||
|
||||
switch = loop_nodes.SxCPIndexSwitch()
|
||||
picked = switch.switch(
|
||||
2,
|
||||
|
||||
Reference in New Issue
Block a user