def setUp(self): self.storage = Storage.create() self.result = StepResult(state='something') self.request = StepRequest(step_id=123, node='some node', dependencies={'some dep': 'some state', 'another dep': 'another state'}, inline_nodes=False, project_tree='some project tree')
def setUp(self): """Setup cache as well as request and result.""" self.storage = Storage.create() self.cache = Cache.create(storage=self.storage) request = StepRequest(step_id=123, node='some node', dependencies={'some dep': 'some state', 'another dep': 'another state'}, inline_nodes=False, project_tree='some project tree') self.result = StepResult(state='something') self.keyed_request = self.storage.key_for_request(request)
def resolve_result(self, step_result): """Resolve state key in step_result.""" return StepResult(state=self._from_key(step_result.state))
def key_for_result(self, step_result): """Make key for result state.""" return StepResult(state=self._to_key(step_result.state))