id3c.tests.test_ad_plugins#

Unit tests for id3c.plans.ad_plugins.

These tests use an ophyd Device with in-memory Signal components as a stand-in for an area-detector file plugin. No EPICS PVs are required, so the tests run on the off-network development host.

Functions#

plugin()

Return a freshly constructed fake plugin.

test_select_skips_omitted(plugin)

omitted kind components are not yielded.

test_select_includes_config_normal_hinted_readonly(plugin)

All other reportable kinds (including read-only) are yielded.

test_select_is_sorted(plugin)

Selection order is alphabetical for predictability.

test_read_prints_table_with_expected_rows(plugin)

The diagnostic prints one row per reportable component.

test_read_marks_readonly_access(plugin)

Read-only component shows R-; read-write shows RW.

test_set_emits_one_mv_per_call(plugin)

Multiple kwargs collapse to a single bps.mv invocation.

test_set_values_propagate_through_messages(plugin)

Each setpoint appears in the corresponding Msg.args.

test_set_no_kwargs_yields_null_message(plugin)

An empty call still yields one message (so @plan does not warn).

test_set_rejects_unknown_kwarg(plugin)

Unknown kwargs raise KeyError before any message is yielded.

test_set_rejects_omitted_kwarg(plugin)

A kwarg naming an omitted-kind component is unknown.

test_set_rejects_readonly_kwarg(plugin)

A kwarg naming a read-only component raises TypeError.

test_set_reports_readonly_before_unknown(plugin)

Both errors at once: TypeError (read-only) wins.

Module Contents#

id3c.tests.test_ad_plugins.plugin()[source]#

Return a freshly constructed fake plugin.

id3c.tests.test_ad_plugins.test_select_skips_omitted(plugin)[source]#

omitted kind components are not yielded.

id3c.tests.test_ad_plugins.test_select_includes_config_normal_hinted_readonly(plugin)[source]#

All other reportable kinds (including read-only) are yielded.

id3c.tests.test_ad_plugins.test_select_is_sorted(plugin)[source]#

Selection order is alphabetical for predictability.

id3c.tests.test_ad_plugins.test_read_prints_table_with_expected_rows(plugin)[source]#

The diagnostic prints one row per reportable component.

id3c.tests.test_ad_plugins.test_read_marks_readonly_access(plugin)[source]#

Read-only component shows R-; read-write shows RW.

id3c.tests.test_ad_plugins.test_set_emits_one_mv_per_call(plugin)[source]#

Multiple kwargs collapse to a single bps.mv invocation.

id3c.tests.test_ad_plugins.test_set_values_propagate_through_messages(plugin)[source]#

Each setpoint appears in the corresponding Msg.args.

id3c.tests.test_ad_plugins.test_set_no_kwargs_yields_null_message(plugin)[source]#

An empty call still yields one message (so @plan does not warn).

id3c.tests.test_ad_plugins.test_set_rejects_unknown_kwarg(plugin)[source]#

Unknown kwargs raise KeyError before any message is yielded.

id3c.tests.test_ad_plugins.test_set_rejects_omitted_kwarg(plugin)[source]#

A kwarg naming an omitted-kind component is unknown.

id3c.tests.test_ad_plugins.test_set_rejects_readonly_kwarg(plugin)[source]#

A kwarg naming a read-only component raises TypeError.

id3c.tests.test_ad_plugins.test_set_reports_readonly_before_unknown(plugin)[source]#

Both errors at once: TypeError (read-only) wins.