Ejemplo n.º 1
0
class Results(object):

    def __init__(self, data_sources, settings):
        self._data_sources = data_sources \
            if not isinstance(data_sources, basestring) else [data_sources]
        self._settings = settings
        self._result = None
        self._js_result = None
        self.return_code = -1

    @property
    def result(self):
        if self._result is None:
            self._result = ResultFromXml(*self._data_sources)
            self._result.configure(self._settings.status_rc,
                                   self._settings.suite_config,
                                   self._settings.statistics_config)
            self.return_code = self._result.return_code
        return self._result

    @property
    def js_result(self):
        if self._js_result is None:
            builder = JsModelBuilder(log_path=self._settings.log,
                                     split_log=self._settings.split_log,
                                     prune_input_to_save_memory=True)
            self._js_result = builder.build_from(self.result)
            self._result = None
        return self._js_result
Ejemplo n.º 2
0
 def result(self):
     if self._result is None:
         self._result = ResultFromXml(*self._data_sources)
         self._result.configure(self._settings.status_rc,
                                self._settings.suite_config,
                                self._settings.statistics_config)
         self.return_code = self._result.return_code
     return self._result