moo.sdk.tests.test_objects_prefetch

Unit tests for moo.sdk.prefetch_property.

Verifies that prefetch_property correctly pre-warms the session property cache with direct properties, inherited properties (nearest-ancestor-wins), and missing property sentinels — matching the semantics of get_property().

Functions

test_already_cached_not_overwritten(t_init, ...)

Entries already in the session cache are not overwritten by a subsequent call.

test_batch_mixed(t_init, t_wizard)

Batch of direct, inherited, and missing cases all resolved in one call.

test_direct_overrides_ancestor(t_init, t_wizard)

Object overrides ancestor value → own value wins.

test_direct_property(t_init, t_wizard)

Object with value set directly → cache contains that value.

test_empty_list_noop(t_init, t_wizard)

Empty list is a no-op and does not raise.

test_inherited_property(t_init, t_wizard)

Child with no direct property inherits from parent.

test_missing_property_sentinel(t_init, t_wizard)

Object with no matching property anywhere in the chain → _PROP_MISSING.

test_nearest_ancestor_wins(t_init, t_wizard)

Nearest ancestor (min depth) takes priority over a more distant one.