コード例 #1
0
 def _write_file(self, path, config, template):
     outfile = file_writer(path) \
         if is_string(path) else path  # unit test hook
     with outfile:
         model_writer = RobotModelWriter(outfile, self._js_model, config)
         writer = HtmlFileWriter(outfile, model_writer)
         writer.write(template)
コード例 #2
0
 def _write_file(self, path, config, template):
     outfile = file_writer(path) \
         if is_string(path) else path  # unit test hook
     with outfile:
         model_writer = RobotModelWriter(outfile, self._js_model, config)
         writer = HtmlFileWriter(outfile, model_writer)
         writer.write(template)
コード例 #3
0
 def __enter__(self):
     if not self.output:
         path = self._output_path()
         if PY2 and self.format == self.tsv_format:
             self.output = binary_file_writer(path)
         else:
             self.output = file_writer(path, newline=self.line_separator)
     return self
コード例 #4
0
 def __enter__(self):
     if not self.output:
         path = self._output_path()
         if PY2 and self.format == self.tsv_format:
             self.output = binary_file_writer(path)
         else:
             self.output = file_writer(path, newline=self.line_separator)
     return self
コード例 #5
0
ファイル: debugfile.py プロジェクト: HelioGuilherme66/RIDE
def DebugFile(path):
    if not path:
        LOGGER.info('No debug file')
        return None
    try:
        outfile = file_writer(path)
    except EnvironmentError as err:
        LOGGER.error("Opening debug file '%s' failed: %s" % (path, err.strerror))
        return None
    else:
        LOGGER.info('Debug file: %s' % path)
        return _DebugFileWriter(outfile)
コード例 #6
0
def create_jsdata(outxml, target):
    settings = RebotSettings({
        'name':
        '<Suite.Name>',
        'critical': ['i?'],
        'noncritical': ['*kek*kone*'],
        'tagstatlink': [
            'force:http://google.com:<kuukkeli&gt;',
            'i*:http://%1/?foo=bar&zap=%1:Title of i%1',
            '?1:http://%1/<&>:Title', '</script>:<url>:<title>'
        ],
        'tagdoc': [
            'test:this_is_*my_bold*_test',
            'IX:*Combined* and escaped <&lt; tag doc', 'i*:Me, myself, and I.',
            '</script>:<doc>'
        ],
        'tagstatcombine':
        ['fooANDi*:No Match', 'long1ORcollections', 'i?:IX', '<*>:<any>']
    })
    result = Results(settings, outxml).js_result
    config = {
        'logURL':
        'log.html',
        'title':
        'This is a long long title. A very long title indeed. '
        'And it even contains some stuff to <esc&ape>. '
        'Yet it should still look good.',
        'minLevel':
        'DEBUG',
        'defaultLevel':
        'DEBUG',
        'reportURL':
        'report.html',
        'background': {
            'fail': 'DeepPink'
        }
    }
    with file_writer(target) as output:
        writer = JsResultWriter(output, start_block='', end_block='')
        writer.write(result, config)
    print('Log:    ', normpath(join(BASEDIR, '..', 'rebot', 'log.html')))
    print('Report: ', normpath(join(BASEDIR, '..', 'rebot', 'report.html')))
コード例 #7
0
 def __enter__(self):
     if self._format == 'HTML':
         self._output_file = file_writer(self._output_path)
         return self._output_file
     return self._output_path
コード例 #8
0
 def _write_split_log(self, index, keywords, strings, path):
     with file_writer(path) as outfile:
         writer = SplitLogWriter(outfile)
         writer.write(keywords, strings, index, basename(path))
コード例 #9
0
ファイル: tidy.py プロジェクト: 357112130/robotframework
 def _get_writer(self, inpath, outpath):
     if PY2 and self._is_tsv(inpath):
         return binary_file_writer(outpath)
     return file_writer(outpath, newline=self._options['line_separator'])
コード例 #10
0
ファイル: testdoc.py プロジェクト: HelioGuilherme66/RIDE
 def _write_test_doc(self, suite, outfile, title):
     with file_writer(outfile) as output:
         model_writer = TestdocModelWriter(output, suite, title)
         HtmlFileWriter(output, model_writer).write(TESTDOC)
コード例 #11
0
ファイル: tidy.py プロジェクト: HelioGuilherme66/RIDE
 def _get_writer(self, inpath, outpath):
     if PY2 and self._is_tsv(inpath):
         return binary_file_writer(outpath)
     return file_writer(outpath, newline=self._options['line_separator'])
コード例 #12
0
 def _write_test_doc(self, suite, outfile, title):
     with file_writer(outfile) as output:
         model_writer = TestdocModelWriter(output, suite, title)
         HtmlFileWriter(output, model_writer).write(TESTDOC)
コード例 #13
0
 def _write_split_log(self, index, keywords, strings, path):
     with file_writer(path) as outfile:
         writer = SplitLogWriter(outfile)
         writer.write(keywords, strings, index, basename(path))
コード例 #14
0
ファイル: output.py プロジェクト: HelioGuilherme66/RIDE
 def __enter__(self):
     if self._format == 'HTML':
         self._output_file = file_writer(self._output_path)
         return self._output_file
     return self._output_path
コード例 #15
0
ファイル: filelogger.py プロジェクト: HelioGuilherme66/RIDE
 def _get_writer(self, path):
     try:
         return file_writer(path)
     except EnvironmentError as err:
         raise DataError(err.strerror)
コード例 #16
0
 def _get_writer(self, path):
     try:
         return file_writer(path)
     except EnvironmentError as err:
         raise DataError(err.strerror)