def create_jsdata(outxml, target): settings = RebotSettings({ 'name': '<Suite.Name>', 'critical': ['i?'], 'noncritical': ['*kek*kone*'], 'tagstatlink': [ 'force:http://google.com:<kuukkeli>', 'i*:http://%1/:Title of i%1', '?1:http://%1/:Title', '</script>:<url>:<title>' ], 'tagdoc': [ 'test:this_is_*my_bold*_test', 'IX:*Combined* and escaped << tag doc', 'i*:Me, myself, and I.', '</script>:<doc>' ], 'tagstatcombine': ['fooANDi*:No Match', 'i?:IX', '<*>:<any>'] }) result = Results(outxml, settings).js_result config = { 'logURL': 'log.html', 'minLevel': 'DEBUG', 'defaultLevel': 'DEBUG', 'reportURL': 'report.html', 'background': { 'fail': 'DeepPink' } } with utf8open(target, 'w') 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'))
def create_jsdata(outxml, target): settings = RebotSettings({ 'name': '<Suite.Name>', 'critical': ['i?'], 'noncritical': ['*kek*kone*'], 'tagstatlink': ['force:http://google.com:<kuukkeli>', 'i*:http://%1/:Title of i%1', '?1:http://%1/:Title', '</script>:<url>:<title>'], 'tagdoc': ['test:this_is_*my_bold*_test', 'IX:*Combined* and escaped << tag doc', 'i*:Me, myself, and I.', '</script>:<doc>'], 'tagstatcombine': ['fooANDi*:No Match', 'i?:IX', '<*>:<any>'] }) result = Results(outxml, settings).js_result config = {'logURL': 'log.html', 'minLevel': 'DEBUG', 'defaultLevel': 'DEBUG', 'reportURL': 'report.html', 'background': {'fail': 'DeepPink'}} with utf8open(target, 'w') 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'))
def output_should_have_correct_line_separators(path): with utf8open(path) as infile: content = infile.read() content = content.replace(os.linesep, '') incorrect = content.count('\n') if incorrect: err = AssertionError("Output '%s' has %d incorrect line separators" % (path, incorrect)) err.ROBOT_CONTINUE_ON_FAILURE = True raise err
def create_jsdata(outxml, target): settings = RebotSettings( { "name": "<Suite.Name>", "critical": ["i?"], "noncritical": ["*kek*kone*"], "tagstatlink": [ "force:http://google.com:<kuukkeli>", "i*:http://%1/:Title of i%1", "?1:http://%1/:Title", "</script>:<url>:<title>", ], "tagdoc": [ "test:this_is_*my_bold*_test", "IX:*Combined* and escaped << tag doc", "i*:Me, myself, and I.", "</script>:<doc>", ], "tagstatcombine": ["fooANDi*:No Match", "i?:IX", "<*>:<any>"], } ) result = Results(outxml, settings).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 utf8open(target, "w") 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"))
def _write_split_log(self, index, keywords, strings, path): with utf8open(path, 'wb') as outfile: writer = SplitLogWriter(outfile) writer.write(keywords, strings, index, basename(path))
def __iter__(self): with utf8open(self._path) as file: for line in file: yield line.rstrip()