7 new revisions:

Revision: 0b82adbd72b3
Author:   Pekka Klärck
Date:     Wed Jun 15 15:46:57 2011
Log: updated depr warning - not removing support for creating scalar variab...
http://code.google.com/p/robotframework/source/detail?r=0b82adbd72b3

Revision: 66c3f3ae98fb
Author:   Pekka Klärck
Date:     Wed Jun 15 15:47:06 2011
Log:      import cleanup
http://code.google.com/p/robotframework/source/detail?r=66c3f3ae98fb

Revision: 6d840a89af6f
Author:   Pekka Klärck
Date:     Thu Jun 16 11:50:30 2011
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=6d840a89af6f

Revision: 00ce5f8d7207
Author:   Pekka Klärck
Date:     Thu Jun 16 12:12:51 2011
Log:      ImportCache cleanup
http://code.google.com/p/robotframework/source/detail?r=00ce5f8d7207

Revision: 2ff3eb321a39
Author:   Pekka Klärck
Date:     Thu Jun 16 12:50:27 2011
Log:      Fixed showing combined pattern and links for tags....
http://code.google.com/p/robotframework/source/detail?r=2ff3eb321a39

Revision: dea786e424e2
Author:   Pekka Klärck
Date:     Thu Jun 16 12:52:33 2011
Log: model.js: fixed handlign combined tag stats after attr had been rename...
http://code.google.com/p/robotframework/source/detail?r=dea786e424e2

Revision: a93604c06812
Author:   Pekka Klärck
Date:     Thu Jun 16 12:53:15 2011
Log:      fixed showing tag stat links
http://code.google.com/p/robotframework/source/detail?r=a93604c06812

==============================================================================
Revision: 0b82adbd72b3
Author:   Pekka Klärck
Date:     Wed Jun 15 15:46:57 2011
Log: updated depr warning - not removing support for creating scalar variabls with list values in 2.6
http://code.google.com/p/robotframework/source/detail?r=0b82adbd72b3

Modified:
 /src/robot/variables/variables.py

=======================================
--- /src/robot/variables/variables.py   Fri May  6 03:32:32 2011
+++ /src/robot/variables/variables.py   Wed Jun 15 15:46:57 2011
@@ -290,7 +290,7 @@
             return self.replace_scalar(value[0])
msg = ("Creating a scalar variable with a list value in the Variable " "table is deprecated and this functionality will be removed in "
-               "Robot Framework 2.6. Create a list variable '@%s' and use "
+               "Robot Framework 2.7. Create a list variable '@%s' and use "
                "it as a scalar variable '%s' instead" % (name[1:], name))
         if path:
             msg += " in file '%s'" % path

==============================================================================
Revision: 66c3f3ae98fb
Author:   Pekka Klärck
Date:     Wed Jun 15 15:47:06 2011
Log:      import cleanup
http://code.google.com/p/robotframework/source/detail?r=66c3f3ae98fb

Modified:
 /src/robot/result/jsparser.py

=======================================
--- /src/robot/result/jsparser.py       Wed Jun 15 10:24:23 2011
+++ /src/robot/result/jsparser.py       Wed Jun 15 15:47:06 2011
@@ -13,10 +13,11 @@
 #  limitations under the License.

 from __future__ import with_statement
+from xml import sax
+
 from robot.result.elementhandlers import RootHandler, Context
 from robot.result.jsondatamodel import DataModel
-from xml import sax
-from xml.sax.handler import ContentHandler
+

 def create_datamodel_from(input_filename):
     robot = _RobotOutputHandler(Context())
@@ -29,7 +30,7 @@
     create_datamodel_from(input_filename).write_to(output)


-class _RobotOutputHandler(ContentHandler):
+class _RobotOutputHandler(sax.handler.ContentHandler):

     def __init__(self, context):
         self._context = context

==============================================================================
Revision: 6d840a89af6f
Author:   Pekka Klärck
Date:     Thu Jun 16 11:50:30 2011
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=6d840a89af6f

Modified:
 /src/robot/result/jsparser.py


==============================================================================
Revision: 00ce5f8d7207
Author:   Pekka Klärck
Date:     Thu Jun 16 12:12:51 2011
Log:      ImportCache cleanup
http://code.google.com/p/robotframework/source/detail?r=00ce5f8d7207

Modified:
 /src/robot/running/importer.py
 /utest/running/test_importer.py

=======================================
--- /src/robot/running/importer.py      Thu Jun 16 07:30:30 2011
+++ /src/robot/running/importer.py      Thu Jun 16 12:12:51 2011
@@ -17,6 +17,7 @@

 from robot.output import LOGGER
 from robot.parsing import ResourceFile
+from robot.errors import FrameworkError
 from robot import utils

 from testlibraries import TestLibrary
@@ -75,21 +76,24 @@


 class ImportCache:
-    """Cache for libraries and resources.
-
-     Unlike dicts, this storage accepts mutable values as keys.
-     """
+    """Keeps track on and optionally caches imported items.
+
+    Handles paths in keys case-insensitively on case-insensitive OSes.
+    Unlike dicts, this storage accepts mutable values in keys.
+    """

     def __init__(self):
         self._keys = []
         self._items = []

     def __setitem__(self, key, item):
+        if not isinstance(key, (basestring, tuple)):
+            raise FrameworkError('Invalid key for ImportCache')
         self._keys.append(self._norm_path_key(key))
         self._items.append(item)

-    def add(self, key):
-        self.__setitem__(key, None)
+    def add(self, key, item=None):
+        self.__setitem__(key, item)

     def __getitem__(self, key):
         key = self._norm_path_key(key)
@@ -101,8 +105,8 @@
         return self._norm_path_key(key) in self._keys

     def _norm_path_key(self, key):
+        if isinstance(key, tuple):
+            return tuple(self._norm_path_key(k) for k in key)
         if isinstance(key, basestring) and os.path.exists(key):
             return utils.normpath(key)
-        if isinstance(key, (tuple, list)):
-            return [self._norm_path_key(k) for k in key]
         return key
=======================================
--- /utest/running/test_importer.py     Wed Jun 15 08:53:17 2011
+++ /utest/running/test_importer.py     Thu Jun 16 12:12:51 2011
@@ -1,35 +1,40 @@
 import unittest

 from robot.running.importer import ImportCache
+from robot.errors import FrameworkError
 from robot.utils.asserts import *


-class TestLibraryCache(unittest.TestCase):
+class TestImportCache(unittest.TestCase):

     def setUp(self):
         self.cache = ImportCache()
         self.cache[('lib', ['a1', 'a2'])] = 'Library'
         self.cache['res'] = 'Resource'

-    def test_add_library(self):
-        assert_equals(self.cache._keys, [['lib', ['a1', 'a2']], 'res'])
+    def test_add_item(self):
+        assert_equals(self.cache._keys, [('lib', ['a1', 'a2']), 'res'])
         assert_equals(self.cache._items, ['Library', 'Resource'])

-    def test_get_existing_library(self):
+    def test_get_existing_item(self):
         assert_equals(self.cache['res'], 'Resource')
         assert_equals(self.cache[('lib', ['a1', 'a2'])], 'Library')
         assert_equals(self.cache[('lib', ['a1', 'a2'])], 'Library')
         assert_equals(self.cache['res'], 'Resource')

-    def test_get_non_existing_library(self):
-        assert_raises(KeyError, self.cache.__getitem__, 'nonex')
- assert_raises(KeyError, self.cache.__getitem__, ('lib1', ['wrong']))
-
-    def test_has_library(self):
+    def test_contains_item(self):
         assert_true(('lib', ['a1', 'a2']) in self.cache)
+        assert_true('res' in self.cache)
         assert_false(('lib', ['a1', 'a2', 'wrong']) in self.cache)
         assert_false('nonex' in self.cache)

+    def test_get_non_existing_item(self):
+        assert_raises(KeyError, self.cache.__getitem__, 'nonex')
+ assert_raises(KeyError, self.cache.__getitem__, ('lib1', ['wrong']))
+
+    def test_invalid_key(self):
+ assert_raises(FrameworkError, self.cache.__setitem__, ['inv'], None)
+

 if __name__ == '__main__':
     unittest.main()

==============================================================================
Revision: 2ff3eb321a39
Author:   Pekka Klärck
Date:     Thu Jun 16 12:50:27 2011
Log:      Fixed showing combined pattern and links for tags.

The former was broken because attribute was renamed.

The latter was broken with totals because jQuery templates apparently
evaluate both sides of {{if links && links.length}} and this obviously
fails when links is undefined. {{if links}}{{if links.length}} works.

It's highly annoying this stuff cannot be tested without browser tests.
http://code.google.com/p/robotframework/source/detail?r=2ff3eb321a39

Modified:
 /src/robot/webcontent/report.html

=======================================
--- /src/robot/webcontent/report.html   Thu Jun 16 05:43:01 2011
+++ /src/robot/webcontent/report.html   Thu Jun 16 12:50:27 2011
@@ -491,18 +491,18 @@
         <td>{{html doc}}</td>
     </tr>
     {{/if}}
-    {{if pattern}}
+    {{if combined}}
     <tr>
         <th>Combined:</th>
-        <td>${pattern}</td>
+        <td>${combined}</td>
     </tr>
     {{/if}}
-    {{if links && links.length}}
+    {{if links}}{{if links.length}}
     <tr>
         <th>Links:</th>
<td>{{each links}}<a href="${$value.url}" title="${$value.url}">${$value.title}</a>{{/each}} </td>
     </tr>
-    {{/if}}
+    {{/if}}{{/if}}
     <tr>
         <th>Status:</th>
<td>${total} total, ${pass} passed, {{if fail}}<span class="fail">${fail} failed</span>{{else}}<span class="pass">0 failed</span>{{/if}}</td>

==============================================================================
Revision: dea786e424e2
Author:   Pekka Klärck
Date:     Thu Jun 16 12:52:33 2011
Log: model.js: fixed handlign combined tag stats after attr had been renamed and changed links to be handled only with tagstats
http://code.google.com/p/robotframework/source/detail?r=dea786e424e2

Modified:
 /src/robot/webcontent/model.js

=======================================
--- /src/robot/webcontent/model.js      Thu Jun 16 05:42:50 2011
+++ /src/robot/webcontent/model.js      Thu Jun 16 12:52:33 2011
@@ -41,8 +41,8 @@
         };
         suite.searchTestsByTag = function (tag) {
             return suite.searchTests(function (test) {
-                if (tag.pattern)
-                    return containsTagPattern(test.tags, tag.pattern);
+                if (tag.combined)
+                    return containsTagPattern(test.tags, tag.combined);
                 return containsTag(test.tags, tag.label);
             });
         };
@@ -320,7 +320,6 @@

     function statElem(stat) {
         stat.total = stat.pass + stat.fail;
-        stat.links = parseLinks(stat.links);
         var percents = calculatePercents(stat.total, stat.pass, stat.fail);
         stat.passPercent = percents[0];
         stat.failPercent = percents[1];
@@ -332,6 +331,7 @@

     function tagStatElem(data) {
         var stat = statElem(data);
+        stat.links = parseLinks(stat.links);
         // TODO: move to templates.
         if (stat.info)
             stat.shownInfo = '(' + stat.info + ')';

==============================================================================
Revision: a93604c06812
Author:   Pekka Klärck
Date:     Thu Jun 16 12:53:15 2011
Log:      fixed showing tag stat links
http://code.google.com/p/robotframework/source/detail?r=a93604c06812

Modified:
 /src/robot/webcontent/model.js

=======================================
--- /src/robot/webcontent/model.js      Thu Jun 16 12:52:33 2011
+++ /src/robot/webcontent/model.js      Thu Jun 16 12:53:15 2011
@@ -357,7 +357,7 @@
         var links = [];
         for (var i=0; i<items.length; i++) {
             parts = items[i].split(':');
-            links[i] = {title: parts[0], url: parts.splice(1,1).join(':')};
+            links[i] = {title: parts[0], url: parts.splice(1).join(':')};
         }
         return links;
     }

Reply via email to