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/: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', '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'))
Beispiel #2
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/: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',
                           '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
Beispiel #4
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/: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", "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))
Beispiel #6
0
 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()
Beispiel #8
0
 def __iter__(self):
     with utf8open(self._path) as file:
         for line in file:
             yield line.rstrip()