zarr.testing.stateful#
Attributes#
Classes#
This state machine models operations that modify a zarr store's |
|
Functions#
|
Module Contents#
- class zarr.testing.stateful.SyncStoreWrapper(store: zarr.abc.store.Store)[source]#
Bases:
zarr.core.sync.SyncMixin
- get(
- key: str,
- prototype: zarr.core.buffer.BufferPrototype,
- class zarr.testing.stateful.ZarrHierarchyStateMachine(store: zarr.abc.store.Store)[source]#
Bases:
zarr.core.sync.SyncMixin
,hypothesis.stateful.RuleBasedStateMachine
This state machine models operations that modify a zarr store’s hierarchy. That is, user actions that modify arrays/groups as well as list operations. It is intended to be used by external stores, and compares their results to a MemoryStore that is assumed to be perfect.
- class zarr.testing.stateful.ZarrStoreStateMachine(store: zarr.abc.store.Store)[source]#
Bases:
hypothesis.stateful.RuleBasedStateMachine
” Zarr store state machine
This is a subclass of a Hypothesis RuleBasedStateMachine. It is testing a framework to ensure that the state of a Zarr store matches an expected state after a set of random operations. It contains a store (currently, a Zarr MemoryStore) and a model, a simplified version of a zarr store (in this case, a dict). It also contains rules which represent actions that can be applied to a zarr store. Rules apply an action to both the store and the model, and invariants assert that the state of the model is equal to the state of the store. Hypothesis then generates sequences of rules, running invariants after each rule. It raises an error if a sequence produces discontinuity between state of the model and state of the store (ie. an invariant is violated). https://hypothesis.readthedocs.io/en/latest/stateful.html