4 new revisions:

Revision: 1945ff2ad4cd
Branch:   default
Author:   Pekka Klärck
Date:     Sun Nov 17 08:48:48 2013 UTC
Log:      little utest cleanup. also finalized one test that missed assert
http://code.google.com/p/robotframework/source/detail?r=1945ff2ad4cd

Revision: 4a99a445bd87
Branch:   default
Author:   Pekka Klärck
Date:     Sun Nov 17 08:54:21 2013 UTC
Log:      ironpython utest fix
http://code.google.com/p/robotframework/source/detail?r=4a99a445bd87

Revision: 5d851fa9ccc0
Branch:   default
Author:   Pekka Klärck
Date:     Sun Nov 17 09:04:02 2013 UTC
Log:      fixed atest flickering with ipy
http://code.google.com/p/robotframework/source/detail?r=5d851fa9ccc0

Revision: 973498ee961a
Branch:   default
Author:   Pekka Klärck
Date:     Sun Nov 17 09:31:28 2013 UTC
Log:      Flattening keywords: Fixed setting flattening message....
http://code.google.com/p/robotframework/source/detail?r=973498ee961a

==============================================================================
Revision: 1945ff2ad4cd
Branch:   default
Author:   Pekka Klärck
Date:     Sun Nov 17 08:48:48 2013 UTC
Log:      little utest cleanup. also finalized one test that missed assert
http://code.google.com/p/robotframework/source/detail?r=1945ff2ad4cd

Modified:
 /utest/utils/test_misc.py
 /utest/utils/test_unic.py

=======================================
--- /utest/utils/test_misc.py   Mon Oct 10 14:30:58 2011 UTC
+++ /utest/utils/test_misc.py   Sun Nov 17 08:48:48 2013 UTC
@@ -1,14 +1,15 @@
 import unittest
 import sys

+from robot.utils.misc import getdoc, printable_name, seq2str
 from robot.utils.asserts import assert_equals
-from robot import utils
-if utils.is_jython:
+
+if sys.platform.startswith('java'):
     import JavaExceptions

-from robot.utils.misc import *

-ipy = sys.platform == 'cli'
+IPY = sys.platform == 'cli'
+

 class TestMiscUtils(unittest.TestCase):

@@ -20,31 +21,31 @@
             assert_equals(seq2str(seq), expected)

     def test_printable_name(self):
-        for inp, exp in [ ('simple', 'Simple'),
-                          ('ALLCAPS', 'ALLCAPS'),
-                          ('name with spaces', 'Name With Spaces'),
-                          ('more   spaces', 'More Spaces'),
-                          ('Cases AND spaces', 'Cases AND Spaces'),
-                          ('under_Score_name', 'Under_Score_name'),
-                          ('camelCaseName', 'CamelCaseName'),
-                          ('with89numbers', 'With89numbers'),
-                          ('with 89 numbers', 'With 89 Numbers'),
-                          ('', '') ]:
+        for inp, exp in [('simple', 'Simple'),
+                         ('ALLCAPS', 'ALLCAPS'),
+                         ('name with spaces', 'Name With Spaces'),
+                         ('more   spaces', 'More Spaces'),
+                         ('Cases AND spaces', 'Cases AND Spaces'),
+                         ('under_Score_name', 'Under_Score_name'),
+                         ('camelCaseName', 'CamelCaseName'),
+                         ('with89numbers', 'With89numbers'),
+                         ('with 89 numbers', 'With 89 Numbers'),
+                         ('', '')]:
             assert_equals(printable_name(inp), exp)

     def test_printable_name_with_code_style(self):
-        for inp, exp in [ ('simple', 'Simple'),
-                          ('ALLCAPS', 'ALLCAPS'),
-                          ('under_score_name', 'Under Score Name'),
- ('under_score and spaces', 'Under Score And Spaces'),
-                          ('miXed_CAPS_nAMe', 'MiXed CAPS NAMe'),
-                          ('camelCaseName', 'Camel Case Name'),
- ('camelCaseWithDigit1', 'Camel Case With Digit 1'), - ('name42WithNumbers666', 'Name 42 With Numbers 666'),
-                          ('12more34numbers', '12 More 34 Numbers'),
-                          ('mixedCAPSCamelName', 'Mixed CAPS Camel Name'),
-                          ('foo-bar', 'Foo-bar'),
-                          ('','') ]:
+        for inp, exp in [('simple', 'Simple'),
+                         ('ALLCAPS', 'ALLCAPS'),
+                         ('under_score_name', 'Under Score Name'),
+ ('under_score and spaces', 'Under Score And Spaces'),
+                         ('miXed_CAPS_nAMe', 'MiXed CAPS NAMe'),
+                         ('camelCaseName', 'Camel Case Name'),
+ ('camelCaseWithDigit1', 'Camel Case With Digit 1'), + ('name42WithNumbers666', 'Name 42 With Numbers 666'),
+                         ('12more34numbers', '12 More 34 Numbers'),
+                         ('mixedCAPSCamelName', 'Mixed CAPS Camel Name'),
+                         ('foo-bar', 'Foo-bar'),
+                         ('', '')]:
             assert_equals(printable_name(inp, code_style=True), exp)


@@ -72,13 +73,13 @@
     def test_non_ascii_doc_in_utf8(self):
         def func():
             """Hyv\xc3\xa4 \xc3\xa4iti!"""
- expected = u'Hyv\xe4 \xe4iti!' if not ipy else u'Hyv\xc3\xa4 \xc3\xa4iti!' + expected = u'Hyv\xe4 \xe4iti!' if not IPY else u'Hyv\xc3\xa4 \xc3\xa4iti!'
         assert_equals(getdoc(func), expected)

     def test_non_ascii_doc_not_in_utf8(self):
         def func():
             """Hyv\xe4 \xe4iti!"""
-        expected = 'Hyv\\xe4 \\xe4iti!' if not ipy else u'Hyv\xe4 \xe4iti!'
+        expected = 'Hyv\\xe4 \\xe4iti!' if not IPY else u'Hyv\xe4 \xe4iti!'
         assert_equals(getdoc(func), expected)

     def test_unicode_doc(self):
=======================================
--- /utest/utils/test_unic.py   Fri Nov 15 11:33:49 2013 UTC
+++ /utest/utils/test_unic.py   Sun Nov 17 08:48:48 2013 UTC
@@ -1,13 +1,16 @@
 import unittest
 import sys

-from robot.utils import unic, is_jython, safe_repr
+from robot.utils import unic, safe_repr
 from robot.utils.asserts import assert_equals, assert_true

-is_ironpython = sys.platform == 'cli'
-unrepresentable_msg = u"<Unrepresentable object '%s'. Error: %s>"

-if is_jython:
+JYTHON = sys.platform.startswith('java')
+IPY = sys.platform == 'cli'
+UNREPR = u"<Unrepresentable object '%s'. Error: %s>"
+
+
+if JYTHON:

     from java.lang import String, Object, RuntimeException
     import JavaObject
@@ -35,13 +38,13 @@
             class ToStringFails(Object):
                 def toString(self):
                     raise RuntimeException('failure in toString')
+            assert_equals(unic(ToStringFails()),
+ UNREPR % ('ToStringFails', 'failure in toString'))

-            unic(ToStringFails())
-

 class TestUnic(unittest.TestCase):

-    if not (is_jython or is_ironpython):
+    if not (JYTHON or IPY):
         def test_unicode_nfc_and_nfd_decomposition_equality(self):
             import unicodedata
             text = u'Hyv\xe4'
@@ -56,14 +59,14 @@
     def test_list_with_objects_containing_unicode_repr(self):
         objects = [UnicodeRepr(), UnicodeRepr()]
         result = unic(objects)
-        if is_jython:
+        if JYTHON:
             # This is actually wrong behavior
             assert_equals(result, '[Hyv\\xe4, Hyv\\xe4]')
-        elif is_ironpython:
+        elif IPY:
             # And so is this.
             assert_equals(result, '[Hyv\xe4, Hyv\xe4]')
         else:
- expected = unrepresentable_msg[:-1] % ('list', 'UnicodeEncodeError: ')
+            expected = UNREPR[:-1] % ('list', 'UnicodeEncodeError: ')
             assert_true(result.startswith(expected))

     def test_bytes(self):
@@ -77,18 +80,18 @@

     def test_failure_in_unicode(self):
         assert_equals(unic(UnicodeFails()),
- unrepresentable_msg % ('UnicodeFails', 'Failure in __unicode__'))
+                      UNREPR % ('UnicodeFails', 'Failure in __unicode__'))

     def test_failure_in_str(self):
         assert_equals(unic(StrFails()),
- unrepresentable_msg % ('StrFails', 'Failure in __str__'))
+                      UNREPR % ('StrFails', 'Failure in __str__'))


 class TestSafeRepr(unittest.TestCase):

     def test_failure_in_repr(self):
         assert_equals(safe_repr(ReprFails()),
- unrepresentable_msg % ('ReprFails', 'Failure in __repr__'))
+                      UNREPR % ('ReprFails', 'Failure in __repr__'))

     def test_repr_of_unicode_has_u_prefix(self):
         assert_equals(safe_repr(u'foo'), "u'foo'")
@@ -99,21 +102,27 @@
         assert_equals(safe_repr([u'foo']), "[u'foo']")
         assert_equals(safe_repr([u'a', 1, u"'"]), "[u'a', 1, u\"'\"]")

-
-class UnicodeRepr:

+class UnicodeRepr(object):
     def __repr__(self):
         return u'Hyv\xe4'

+
 class UnicodeFails(object):
-    def __unicode__(self): raise RuntimeError('Failure in __unicode__')
+    def __unicode__(self):
+        raise RuntimeError('Failure in __unicode__')
+

 class StrFails(object):
-    def __unicode__(self): raise UnicodeError()
-    def __str__(self): raise RuntimeError('Failure in __str__')
+    def __unicode__(self):
+        raise UnicodeError()
+    def __str__(self):
+        raise RuntimeError('Failure in __str__')
+

 class ReprFails(object):
-    def __repr__(self): raise RuntimeError('Failure in __repr__')
+    def __repr__(self):
+        raise RuntimeError('Failure in __repr__')


 if __name__ == '__main__':

==============================================================================
Revision: 4a99a445bd87
Branch:   default
Author:   Pekka Klärck
Date:     Sun Nov 17 08:54:21 2013 UTC
Log:      ironpython utest fix
http://code.google.com/p/robotframework/source/detail?r=4a99a445bd87

Modified:
 /utest/utils/test_unic.py

=======================================
--- /utest/utils/test_unic.py   Sun Nov 17 08:48:48 2013 UTC
+++ /utest/utils/test_unic.py   Sun Nov 17 08:54:21 2013 UTC
@@ -69,14 +69,28 @@
             expected = UNREPR[:-1] % ('list', 'UnicodeEncodeError: ')
             assert_true(result.startswith(expected))

-    def test_bytes(self):
-        assert_equals(unic('\x00-\x01-\x02'), u'\x00-\x01-\x02')
-        assert_equals(unic('hyv\xe4'), u'hyv\\xe4')
-        assert_equals(unic('\x00-\x01-\x02-\xe4'), u'\x00-\x01-\x02-\\xe4')
+    def test_bytes_below_128(self):
+        assert_equals(unic('\x00-\x01-\x02-\x7f'), u'\x00-\x01-\x02-\x7f')

-    def test_bytes_with_newlines_tabs_etc(self):
-        # 'string_escape' escapes some chars we don't want to be escaped
-        assert_equals(unic("\x00\xe4\n\t\r\\'"), u"\x00\\xe4\n\t\r\\'")
+    if not IPY:
+
+        def test_bytes_above_128(self):
+            assert_equals(unic('hyv\xe4'), u'hyv\\xe4')
+ assert_equals(unic('\x00-\x01-\x02-\xe4'), u'\x00-\x01-\x02-\\xe4')
+
+        def test_bytes_with_newlines_tabs_etc(self):
+ # 'string_escape' escapes some chars we don't want to be escaped
+            assert_equals(unic("\x00\xe4\n\t\r\\'"), u"\x00\\xe4\n\t\r\\'")
+
+    else:
+
+        def test_bytes_above_128(self):
+            assert_equals(unic('hyv\xe4'), u'hyv\xe4')
+ assert_equals(unic('\x00-\x01-\x02-\xe4'), u'\x00-\x01-\x02-\xe4')
+
+        def test_bytes_with_newlines_tabs_etc(self):
+ # 'string_escape' escapes some chars we don't want to be escaped
+            assert_equals(unic("\x00\xe4\n\t\r\\'"), u"\x00\xe4\n\t\r\\'")

     def test_failure_in_unicode(self):
         assert_equals(unic(UnicodeFails()),

==============================================================================
Revision: 5d851fa9ccc0
Branch:   default
Author:   Pekka Klärck
Date:     Sun Nov 17 09:04:02 2013 UTC
Log:      fixed atest flickering with ipy
http://code.google.com/p/robotframework/source/detail?r=5d851fa9ccc0

Modified:
 /atest/robot/cli/rebot/remove_keywords/wait_until_keyword_succeeds.txt

=======================================
--- /atest/robot/cli/rebot/remove_keywords/wait_until_keyword_succeeds.txt Wed Sep 12 23:05:24 2012 UTC +++ /atest/robot/cli/rebot/remove_keywords/wait_until_keyword_succeeds.txt Sun Nov 17 09:04:02 2013 UTC
@@ -3,18 +3,21 @@
 Force Tags        regression    pybot    jybot
 Resource          remove_keywords_resource.txt

+*** Variables ***
+${DOC} Waits until the specified keyword succeeds or the given timeout expires.
+
 *** Test Cases ***
 Last failing Step is not removed
     ${tc}=    Check Number Of Keywords     Fail Until The End    1
- Should End With ${tc.kws[0].doc} failing steps removed using --RemoveKeywords option._ + Should Match ${tc.kws[0].doc} ${DOC}\n\n_? failing step* removed using --RemoveKeywords option._

 Last passing Step is not removed
     ${tc}=    Check Number Of Keywords    Passes before timeout    2
- Should Be Equal ${tc.kws[0].doc} Waits until the specified keyword succeeds or the given timeout expires.\n\n_1 failing step removed using --RemoveKeywords option._ + Should Be Equal ${tc.kws[0].doc} ${DOC}\n\n_1 failing step removed using --RemoveKeywords option._

 Steps containing warnings are not removed
     ${tc}=   Check Number Of Keywords    Warnings    3
- Should be Equal ${tc.kws[0].doc} Waits until the specified keyword succeeds or the given timeout expires.
+    Should be Equal    ${tc.kws[0].doc}    ${DOC}
     Check Number Of Keywords    One Warning    2

 Nested Wait Until keywords are removed

==============================================================================
Revision: 973498ee961a
Branch:   default
Author:   Pekka Klärck
Date:     Sun Nov 17 09:31:28 2013 UTC
Log:      Flattening keywords: Fixed setting flattening message.

Update issue 1551
Fixed setting the message about flattening. `elem.text` should not be modified during the start event, only at the end!

Interestingly this bug only failed our tests on IronPython. With other parsers the text apparently was always fully read already at the start. It could have failed also elsewhere so good that it was spotted.
http://code.google.com/p/robotframework/source/detail?r=973498ee961a

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

=======================================
--- /src/robot/result/resultbuilder.py  Tue Nov  5 12:36:31 2013 UTC
+++ /src/robot/result/resultbuilder.py  Sun Nov 17 09:31:28 2013 UTC
@@ -114,7 +114,7 @@
                     started += 1
                 elif match(elem.attrib['name']):
                     started = 0
-            if started == 0 and event == 'start' and tag == 'doc':
+            if started == 0 and event == 'end' and tag == 'doc':
                 elem.text = ('%s\n\n_*Keyword content flattened.*_'
                              % (elem.text or '')).strip()
             if started <= 0 or tag == 'msg':

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to