3 new revisions:
Revision: 3205e65a7a8a
Author: Mikko Korpela <[email protected]>
Date: Mon Nov 28 04:06:43 2011
Log: Fix splitlog
http://code.google.com/p/robotframework/source/detail?r=3205e65a7a8a
Revision: f913d55c6bd7
Author: Mikko Korpela <[email protected]>
Date: Mon Nov 28 04:08:52 2011
Log: merge
http://code.google.com/p/robotframework/source/detail?r=f913d55c6bd7
Revision: fcf313a8eed4
Author: Mikko Korpela <[email protected]>
Date: Mon Nov 28 04:09:19 2011
Log: merge
http://code.google.com/p/robotframework/source/detail?r=fcf313a8eed4
==============================================================================
Revision: 3205e65a7a8a
Author: Mikko Korpela <[email protected]>
Date: Mon Nov 28 04:06:43 2011
Log: Fix splitlog
http://code.google.com/p/robotframework/source/detail?r=3205e65a7a8a
Modified:
/src/robot/result/jsondatamodelhandlers.py
=======================================
--- /src/robot/result/jsondatamodelhandlers.py Wed Nov 16 21:39:50 2011
+++ /src/robot/result/jsondatamodelhandlers.py Mon Nov 28 04:06:43 2011
@@ -203,18 +203,22 @@
context.start_keyword()
def build(self, keyword):
+ result = self._create_result(keyword)
self._context.end_keyword()
+ return result
+
+ def _create_result(self, keyword):
return [self._types[keyword.type],
- self._id(keyword.name),
- self._id(keyword.timeout),
- self._id_html(keyword.doc),
- self._id(', '.join(keyword.args)),
- self._status(keyword),
- self._keywords,
- self._messages]
+ self._id(keyword.name),
+ self._id(keyword.timeout),
+ self._id_html(keyword.doc),
+ self._id(', '.join(keyword.args)),
+ self._status(keyword),
+ self._keywords,
+ self._messages]
-class SuiteKeywordHandler(_Handler):
+class SuiteKeywordHandler(KeywordHandler):
def __init__(self, context):
_Handler.__init__(self, context)
@@ -222,14 +226,7 @@
def build(self, keyword):
self._context.end_suite_setup_or_teardown(self._keywords)
- return [KeywordHandler._types[keyword.type],
- self._id(keyword.name),
- self._id(keyword.timeout),
- self._id_html(keyword.doc),
- self._id(', '.join(keyword.args)),
- self._status(keyword),
- self._keywords,
- self._messages]
+ return self._create_result(keyword)
class StatusHandler(_Handler):
==============================================================================
Revision: f913d55c6bd7
Author: Mikko Korpela <[email protected]>
Date: Mon Nov 28 04:08:52 2011
Log: merge
http://code.google.com/p/robotframework/source/detail?r=f913d55c6bd7
Deleted:
/src/robot/utils/domwrapper.py
/utest/utils/test_domwrapper.py
=======================================
--- /src/robot/utils/domwrapper.py Sun Feb 6 01:24:10 2011
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright 2008-2011 Nokia Siemens Networks Oyj
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import etreewrapper
-
-
-class DomWrapper(object):
-
- def __init__(self, path=None, string=None, node=None):
- """Initialize by giving 'path' to an xml file or xml as a 'string'.
-
- Alternative initialization by giving dom 'node' ment to be used
only
- internally. 'path' may actually also be an already opened file
object
- (or anything accepted by ElementTree.parse).
- """
- node = etreewrapper.get_root(path, string, node)
- self.source = path
- self.name = node.tag
- self.attrs = dict(node.items())
- self.text = node.text or ''
- self.children = [DomWrapper(path, node=child) for child in
list(node)]
-
- def get_nodes(self, path):
- """Returns a list of descendants matching given 'path'.
-
- Path must be a string in format 'child_name/grandchild_name/etc'.
No
- slash is allowed at the beginning or end of the path string.
Returns an
- empty list if no matching descendants found and raises
AttributeError
- if path is invalid.
- """
- if not isinstance(path, basestring) \
- or path == '' or path[0] == '/' or path[-1] == '/':
- raise AttributeError("Invalid path '%s'" % path)
- matches = []
- for child in self.children:
- matches += child._get_matching_elements(path.split('/'))
- return matches
-
- def _get_matching_elements(self, tokens):
- if self.name != tokens[0]:
- return []
- elif len(tokens) == 1:
- return [self]
- else:
- matches = []
- for child in self.children:
- matches += child._get_matching_elements(tokens[1:])
- return matches
-
- def get_node(self, path):
- """Similar as get_nodes but checks that exactly one node is found.
-
- Node is returned as is (i.e. not in a list) and AttributeError
risen if
- no match or more than one match found.
- """
- nodes = self.get_nodes(path)
- if len(nodes) == 0:
- raise AttributeError("No nodes matching path '%s' found" %
path)
- if len(nodes) > 1:
- raise AttributeError("Multiple nodes matching path '%s'
found" % path)
- return nodes[0]
-
- def get_attr(self, name, default=None):
- """Helper for getting node's attributes.
-
- Otherwise equivalent to 'node.attrs.get(name, default)' but raises
- an AttributeError if no value found and no default given.
- """
- ret = self.attrs.get(name, default)
- if ret is None:
- raise AttributeError("No attribute '%s' found" % name)
- return ret
-
- def __getattr__(self, name):
- """Syntactic sugar for get_nodes (e.g. dom.elem[0].subelem).
-
- Differs from get_nodes so that if not matching nodes are found an
- AttributeError is risen instead of returning an empty list.
- """
- nodes = self.get_nodes(name)
- if not nodes:
- raise AttributeError("No nodes matching path '%s' found" %
name)
- return nodes
-
- def __getitem__(self, name):
- """Syntactic sugar for get_node (e.g. dom['elem/subelem'])"""
- try:
- return self.get_node(name)
- except AttributeError:
- raise IndexError("No node '%s' found" % name)
-
- def __repr__(self):
- """Return node name. Mainly for debugging purposes."""
- return self.name
=======================================
--- /utest/utils/test_domwrapper.py Thu Nov 18 08:34:58 2010
+++ /dev/null
@@ -1,85 +0,0 @@
-import sys
-import unittest
-import StringIO
-
-from robot.utils.asserts import assert_equals, assert_raises
-from robot.utils import DomWrapper
-
-
-XML_STR = '''<?xml version="1.0" encoding="UTF-8"?>
-<!-- Comment before root - all comments (and doctypes) should be ignored
-->
-<root>
- <!-- Comment inside root -->
- <elem a1="v1" a2="v2">
- <txt>hello</txt>
- <!-- Comment again -->
- </elem>
- <elem/>
- <!--
- Multiline
- comment
- <elem><txt>still in comment</txt></elem>
- -->
- <elem a="v">
- <elem>
- <txt>hi</txt>
- </elem>
- <elem>
- <txt/>
- </elem>
- </elem>
-</root>
-<!-- Comment after root -->
-'''
-
-# Tests only read from dom so we can create it only once
-DOM = DomWrapper(string=XML_STR)
-
-
-class TestDomWrapper(unittest.TestCase):
-
- def test_root(self):
- assert_equals(DOM.name, 'root')
- assert_equals(DOM.attrs, {})
-
- def test_elem(self):
- e1 = DOM.elem[0] # using __getattr__ sugar
- e2 = DOM.elem[1]
- e3 = DOM.elem[2]
- e31 = e3.elem[0]
- e32 = e3.elem[1]
- for elem, exp_attrs in [ (e1,{'a1':'v1','a2':'v2'}), (e2,{}),
- (e3,{'a':'v'}), (e31,{}), (e32,{}) ]:
- assert_equals(elem.name, 'elem')
- assert_equals(elem.attrs, exp_attrs)
-
- def test_text(self):
- t1 = DOM.elem[0].txt[0]
- t2 = DOM.elem[2].elem[0].txt[0]
- t3 = DOM.elem[2].elem[1].txt[0]
- for elem, exp_text in [ (t1,'hello'), (t2,'hi'), (t3,'') ]:
- assert_equals(elem.name, 'txt')
- assert_equals(elem.text, exp_text)
- assert_equals(elem.attrs, {})
- assert_equals(elem.children, [])
-
- def test_get_nodes(self):
- nodes = DOM.get_nodes('elem/txt')
- assert_equals(len(nodes), 1)
- assert_equals(nodes[0].text, 'hello')
- nodes = DOM.get_nodes('elem/elem/txt')
- assert_equals(len(nodes), 2)
- assert_equals(nodes[0].text, 'hi')
- assert_equals(nodes[1].text, '')
-
- def test_sugar(self):
- node = DOM.get_nodes('elem')[0].get_node('txt')
- assert_equals(DOM.elem[0].txt[0], node)
- assert_equals(DOM['elem/txt'], node)
- assert_raises(AttributeError, DOM.__getattr__, 'nonexisting')
- assert_raises(IndexError, DOM.__getitem__, 'nonexisting')
- assert_raises(IndexError, DOM.__getitem__, 2)
-
-
-if __name__ == "__main__":
- unittest.main()
==============================================================================
Revision: fcf313a8eed4
Author: Mikko Korpela <[email protected]>
Date: Mon Nov 28 04:09:19 2011
Log: merge
http://code.google.com/p/robotframework/source/detail?r=fcf313a8eed4
Deleted:
/atest/robot/output/statistics_with_rebot.html
=======================================
--- /atest/robot/output/statistics_with_rebot.html Mon May 24 23:59:40 2010
+++ /dev/null
@@ -1,3197 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <style type="text/css">
-html {
- font-family: Arial,Helvetica,sans-serif;
- background-color: white;
- color: black;
-}
-p {
- max-width: 60em;
-}
-table {
- border-collapse: collapse;
- empty-cells: show;
- margin: 1em 0em;
- border: 0.1em solid black;
-}
-th, td {
- border-style: solid;
- border-width: 0.05em 0.1em;
- border-color: black;
- padding: 0.1em 0.2em;
- height: 1.5em;
-}
-th {
- background-color: rgb(192, 192, 192);
- color: black;
- border-width: 0.1em;
- font-weight: bold;
- text-align: center;
- text-transform: capitalize;
- letter-spacing: 0.1em;
-}
-/* Widths of named columns */
-col.name {
- width: 10em;
-}
-.action, .value, .arg {
- width: 15em;
-}
-/* Properties for the name column
-- td:first-child should work in CSS 2.1 avare browsers (tested in Firefox)
-- col.name is against specs but works in IE
-*/
-td:first-child, col.name {
- background-color: rgb(240, 240, 240);
- text-transform: capitalize;
- letter-spacing: 0.1em;
-}
-/* required for IE */
-th {
- font-style: normal;
-}
- </style><title>Robot Test Cases</title></head><body>
-
-
-
-
-
-
-
-
-
-
-
-<h1>Robot Test Cases</h1>
-
-
-
-
-
-
-
-
-
-
-
-
-<table border="1">
-
-
-
-
-
-
-
-
-
-
-
- <colgroup span="99"><col class="name"><col class="value"
span="4"></colgroup>
- <thead>
- <tr>
-
-
-
-
-
-
-
-
-
-
-
- <th>Setting</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Value</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Value</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>value</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Value</th>
-
-
-
-
-
-
-
-
-
-
-
- </tr>
-
-
-
-
-
-
-
-
-
-
-
- </thead>
- <tbody>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <tr>
-
-
-
-
-
-
-
-
-
-
- <td>Force Tags</td>
-
-
-
-
-
-
-
-
-
-
- <td>regression</td>
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
- </tr>
-
-
-
-
-
-
-
-
-
-
- <tr>
-
-
-
-
-
-
-
-
-
-
- <td align="undefined" valign="undefined">Default Tags</td>
-
-
-
-
-
-
-
-
-
-
- <td align="undefined" valign="undefined">pybot</td>
-
-
-
-
-
-
-
-
-
-
- <td align="undefined" valign="undefined">jybot</td>
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
- </tr>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <tr>
-
-
-
-
-
-
-
-
-
-
-
- <td>Resource</td>
-
-
-
-
-
-
-
-
-
-
- <td>atest_resource.txt</td>
-
-
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
-
- </tr>
-
-
-
- <tr>
-
-
-
- <td align="undefined" valign="undefined">Suite Setup</td>
-
-
-
- <td align="undefined" valign="undefined">My Setup</td>
-
-
-
- <td align="undefined" valign="undefined"><br>
-</td>
-
-
-
- <td align="undefined" valign="undefined"><br>
-</td>
-
-
-
- <td align="undefined" valign="undefined"><br>
-</td>
-
-
-
- </tr>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </tbody>
-</table>
-
-
-
-
-
-
-
-
-
-
-
-
-<table border="1">
-
-
-
-
-
-
-
-
-
-
-
- <colgroup span="99"><col class="name"><col class="value"
span="4"></colgroup>
- <thead>
- <tr>
-
-
-
-
-
-
-
-
-
-
-
- <th>Variable</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Value</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Value</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Value</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Value</th>
-
-
-
-
-
-
-
-
-
-
-
- </tr>
-
-
-
-
-
-
-
-
-
-
-
- </thead>
- <tbody>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <tr>
-
-
-
- <td align="undefined" valign="undefined"><br>
-</td>
-
-
-
- <td align="undefined" valign="undefined"><br>
-</td>
-
-
-
- <td align="undefined" valign="undefined"><br>
-</td>
-
-
-
- <td align="undefined" valign="undefined"><br>
-</td>
-
-
-
- <td align="undefined" valign="undefined"><br>
-</td>
-
-
-
- </tr>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </tbody>
-</table>
-
-
-
-
-
-
-
-
-
-
-
-
-<table border="1">
-
-
-
-
-
-
-
-
-
-
-
- <colgroup span="99"><col class="name"><col class="action"><col
class="arg" span="3"></colgroup>
- <thead>
- <tr>
-
-
-
-
-
-
-
-
-
-
-
- <th>Test Case</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Action</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Argument</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Argument</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Argument</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Argument</th>
-
-
-
-
-
-
-
-
-
-
-
- <th>Argument</th>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </tr>
-
-
-
-
-
-
-
-
-
-
-
- </thead>
- <tbody>
-
-
-
-
-
-
-
-
-
-
-
- <tr>
-
-
-
-
-
-
-
-
-
-
- <td align="undefined" valign="undefined">Statistics Should Be
Written to XML</td>
-
-
-
-
-
-
-
-
-
-
- <td align="undefined" valign="undefined">${output} =</td>
-
-
-
-
-
-
-
-
-
-
- <td align="undefined" valign="undefined">Get File</td>
-
-
-
-
-
-
-
-
-
-
- <td>${OUTFILE}</td>
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
- <td><br>
-</td>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- </tr>
-
-
-
-
-
-
-
-
-
-
- <tr>
-
- <td><br>
-</td>
-
- <td>${exp} =</td>
-
- <td>Catenate</td>
-
- <td>SEPARATOR=\n</td>
-
- <td>(?s)</td>
-
- <td><statistics></td>
-
- <td><total></td>
-
- </tr>
-
- <tr>
-
- <td><br>
-</td>
***The diff for this file has been truncated for email.***