MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / __init__

Method __init__

misc/python/materialize/zippy/framework.py:181–205  ·  view source on GitHub ↗

Generate a new Zippy test. Args: scenario: The Scenario to pick actions from. actions: The number of actions to generate.

(
        self, scenario: "Scenario", actions: int, max_execution_time: timedelta
    )

Source from the content-addressed store, hash-verified

179 """A Zippy test, consisting of a sequence of actions."""
180
181 def __init__(
182 self, scenario: "Scenario", actions: int, max_execution_time: timedelta
183 ) -> None:
184 """Generate a new Zippy test.
185
186 Args:
187 scenario: The Scenario to pick actions from.
188 actions: The number of actions to generate.
189 """
190 self._scenario = scenario
191 self._actions: list[Action] = []
192 self._final_actions: list[Action] = []
193 self._capabilities = Capabilities()
194 self._actions_with_weight: dict[ActionOrFactory, float] = (
195 self._scenario.actions_with_weight()
196 )
197 self._state = State()
198 self._max_execution_time: timedelta = max_execution_time
199
200 for action_or_factory in self._scenario.bootstrap():
201 self._actions.extend(self.generate_actions(action_or_factory))
202
203 while len(self._actions) < actions:
204 action_or_factory = self._pick_action_or_factory()
205 self._actions.extend(self.generate_actions(action_or_factory))
206
207 def generate_actions(self, action_def: ActionOrFactory) -> list[Action]:
208 if isinstance(action_def, ActionFactory):

Callers

nothing calls this directly

Calls 7

generate_actionsMethod · 0.95
CapabilitiesClass · 0.70
StateClass · 0.70
actions_with_weightMethod · 0.45
bootstrapMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected