2 new revisions:

Revision: 9a7e0504df68
Author:   Pekka Klärck
Date:     Wed Dec 14 04:26:09 2011
Log: Fixed message linking on Jython and added workaround for StringIndex b...
http://code.google.com/p/robotframework/source/detail?r=9a7e0504df68

Revision: 90a8bfd9333f
Author:   Pekka Klärck
Date:     Wed Dec 14 04:26:15 2011
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=90a8bfd9333f

==============================================================================
Revision: 9a7e0504df68
Author:   Pekka Klärck
Date:     Wed Dec 14 04:26:09 2011
Log: Fixed message linking on Jython and added workaround for StringIndex bug on Jython.
http://code.google.com/p/robotframework/source/detail?r=9a7e0504df68

Modified:
 /src/robot/reporting/jsmodelbuilders.py
 /src/robot/reporting/stringcache.py
 /utest/reporting/test_stringcache.py

=======================================
--- /src/robot/reporting/jsmodelbuilders.py     Wed Dec 14 03:26:44 2011
+++ /src/robot/reporting/jsmodelbuilders.py     Wed Dec 14 04:26:09 2011
@@ -174,4 +174,4 @@
     def build(self, msg):
         model = self._build(msg)
         link = self._context.link(msg)
-        return model if not link else model + (link,)
+        return model if link is None else model + (link,)
=======================================
--- /src/robot/reporting/stringcache.py Wed Dec  7 12:30:34 2011
+++ /src/robot/reporting/stringcache.py Wed Dec 14 04:26:09 2011
@@ -18,9 +18,13 @@


 class StringIndex(long):
+    # Methods below are needed due to http://bugs.jython.org/issue1828

     def __str__(self):
-        return long.__str__(self).rstrip('L')  # Jython adds L at the end
+        return long.__str__(self).rstrip('L')
+
+    def __nonzero__(self):
+        return bool(long(self))


 class StringCache(object):
=======================================
--- /utest/reporting/test_stringcache.py        Wed Dec  7 12:40:22 2011
+++ /utest/reporting/test_stringcache.py        Wed Dec 14 04:26:09 2011
@@ -60,6 +60,11 @@
         assert_equals(str(value), str(target))
         assert_false(str(value).endswith('L'))

+    def test_truth(self):
+        assert_true(StringIndex(1))
+        assert_true(StringIndex(-42))
+        assert_false(StringIndex(0))
+

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

==============================================================================
Revision: 90a8bfd9333f
Author:   Pekka Klärck
Date:     Wed Dec 14 04:26:15 2011
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=90a8bfd9333f


Reply via email to