3 new revisions:

Revision: 068200916073
Branch:   default
Author:   Pekka Klärck
Date:     Thu Nov 21 15:10:59 2013 UTC
Log: Ooops, accidentally broke dynamic library support with java libs....
http://code.google.com/p/robotframework/source/detail?r=068200916073

Revision: 45fe39ccd3bc
Branch:   default
Author:   Pekka Klärck
Date:     Thu Nov 21 15:11:50 2013 UTC
Log: testlibraries: use new is_java_init/method utils instead of creating t...
http://code.google.com/p/robotframework/source/detail?r=45fe39ccd3bc

Revision: 07aa2951ea02
Branch:   default
Author:   Pekka Klärck
Date:     Thu Nov 21 15:16:16 2013 UTC
Log:      IronPython unit test fix....
http://code.google.com/p/robotframework/source/detail?r=07aa2951ea02

==============================================================================
Revision: 068200916073
Branch:   default
Author:   Pekka Klärck
Date:     Thu Nov 21 15:10:59 2013 UTC
Log:      Ooops, accidentally broke dynamic library support with java libs.

Update issue 1500
Thought we run tests before last commit but apparently not. Fixed broken Java dynamic library support now.
http://code.google.com/p/robotframework/source/detail?r=068200916073

Modified:
 /src/robot/running/dynamicmethods.py
 /src/robot/utils/robotinspect.py

=======================================
--- /src/robot/running/dynamicmethods.py        Thu Nov 21 12:51:47 2013 UTC
+++ /src/robot/running/dynamicmethods.py        Thu Nov 21 15:10:59 2013 UTC
@@ -79,15 +79,15 @@
 class RunKeyword(_DynamicMethod):
     _underscore_name = 'run_keyword'

-    def __init__(self, lib):
-        _DynamicMethod.__init__(self, lib)
+    @property
+    def kwargs_supported(self):
         argspec = self._parse_argspec(self.method)
-        self.kwargs_supported = len(argspec.positional) == 3
+        return len(argspec.positional) == 3

     def _parse_argspec(self, method):
         if not is_java_method(method):
             return PythonArgumentParser().parse(method)
-        func = method.im_func
+        func = method.im_func if hasattr(method, 'im_func') else method
         signatures = func.argslist[:func.nargs]
         return JavaArgumentParser().parse(signatures)

=======================================
--- /src/robot/utils/robotinspect.py    Thu Nov 21 12:51:47 2013 UTC
+++ /src/robot/utils/robotinspect.py    Thu Nov 21 15:10:59 2013 UTC
@@ -22,8 +22,8 @@
         return isinstance(init, PyReflectedConstructor)

     def is_java_method(method):
-        return hasattr(method, 'im_func') \
-            and isinstance(method.im_func, PyReflectedFunction)
+        func = method.im_func if hasattr(method, 'im_func') else method
+        return isinstance(func, PyReflectedFunction)

 else:


==============================================================================
Revision: 45fe39ccd3bc
Branch:   default
Author:   Pekka Klärck
Date:     Thu Nov 21 15:11:50 2013 UTC
Log: testlibraries: use new is_java_init/method utils instead of creating them here
http://code.google.com/p/robotframework/source/detail?r=45fe39ccd3bc

Modified:
 /src/robot/running/testlibraries.py

=======================================
--- /src/robot/running/testlibraries.py Thu Nov 21 12:51:47 2013 UTC
+++ /src/robot/running/testlibraries.py Thu Nov 21 15:11:50 2013 UTC
@@ -19,7 +19,8 @@

 from robot.errors import DataError
 from robot.output import LOGGER
-from robot.utils import (getdoc, get_error_details, Importer, normalize,
+from robot.utils import (getdoc, get_error_details, Importer,
+                         is_java_init, is_java_method, normalize,
                          NormalizedDict, seq2str2, unic)

 from .baselibrary import BaseLibrary
@@ -30,19 +31,8 @@

 if sys.platform.startswith('java'):
     from java.lang import Object
-    from org.python.core import PyReflectedConstructor, PyReflectedFunction
-
-    def is_java_init(method):
-        return isinstance(method, PyReflectedConstructor)
-
-    def is_java_method(method):
-        # inspect.isroutine doesn't work with methods from Java classes
-        # prior to Jython 2.5.2: http://bugs.jython.org/issue1223
-        return isinstance(method, PyReflectedFunction)
-
 else:
     Object = None
-    is_java_init = is_java_method = lambda method: False


 def TestLibrary(name, args=None, variables=None, create_handlers=True):

==============================================================================
Revision: 07aa2951ea02
Branch:   default
Author:   Pekka Klärck
Date:     Thu Nov 21 15:16:16 2013 UTC
Log:      IronPython unit test fix.

Update issue 1500
Fixed unit test that didn't work with IronPython due to lambda.__name__ differences.
http://code.google.com/p/robotframework/source/detail?r=07aa2951ea02

Modified:
 /utest/running/test_handlers.py

=======================================
--- /utest/running/test_handlers.py     Thu Nov 21 12:51:47 2013 UTC
+++ /utest/running/test_handlers.py     Thu Nov 21 15:16:16 2013 UTC
@@ -154,7 +154,7 @@
self._assert_fails('Only last argument can be kwargs.', argspec)

     def test_missing_kwargs_support(self):
-        self._assert_fails("Too few '<lambda>' method parameters"
+        self._assert_fails("Too few 'run_keyword' method parameters"
                            " for **kwargs support.",
                            ['**kwargs'])

@@ -192,6 +192,7 @@
             lib.run_keyword = lambda name, args, kwargs: None
         else:
             lib.run_keyword = lambda name, args: None
+        lib.run_keyword.__name__ = 'run_keyword'
         doc = GetKeywordDocumentation(lib)._handle_return_value(doc)
         argspec = GetKeywordArguments(lib)._handle_return_value(argspec)
         return DynamicHandler(lib, 'mock', RunKeyword(lib), doc, argspec)

--

--- 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