コード例 #1
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'))
コード例 #2
0
ファイル: create_jsdata.py プロジェクト: atthaboon/RIDE
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'))
コード例 #3
0
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
コード例 #4
0
ファイル: create_jsdata.py プロジェクト: nagyist/RIDE
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"))
コード例 #5
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))
コード例 #6
0
ファイル: logreportwriters.py プロジェクト: Acidburn0zzz/RIDE
 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))
コード例 #7
0
 def __iter__(self):
     with utf8open(self._path) as file:
         for line in file:
             yield line.rstrip()
コード例 #8
0
ファイル: normaltemplate.py プロジェクト: Acidburn0zzz/RIDE
 def __iter__(self):
     with utf8open(self._path) as file:
         for line in file:
             yield line.rstrip()