def assertOutput(self, description, before, after): description = description.copy() description['output'] = {'type': 'test'} from echomesh.output.Registry import make_output output = make_output(description) output.emit_output(before) self.assertEqual(output.output[0].data, after)
def __init__(self, name, data, output_cache): self._name = name self._output_cache = output_cache if data: from echomesh.output.Registry import make_output self._output = make_output(data) else: self._output = default_output() self._output.start()
def finish_construction(self, description, is_redirect=True): self.clients = [] if is_redirect: output = description.pop('output', None) if output is None: raise Exception('No output in %s' % self.__class__.__name__) if not isinstance(output, (list, tuple)): output = [output] self.output = [make_output(o) for o in output] if False: # TODO for o in self.output: o.add_client(self) else: self.output = [] if description: LOGGER.error('Unknown keywords %s in output %s', description, self.__class__.__name__)
def _on_run(self): super(PatternElement, self)._on_run() if not self.output: self.output = make_output(self.output_data) self.output.add_client(self)