Revision: 970158b335fb
Branch: default
Author: Pekka Klärck
Date: Mon Jun 16 14:17:45 2014 UTC
Log: DateTime: Support for Jython 2.7
Update issue 415
Workaround for Jython 2.7 beta 2 not supporting %f directive fully.
http://code.google.com/p/robotframework/source/detail?r=970158b335fb
Modified:
/atest/testdata/standard_libraries/datetime/convert_date_input_format.txt
/atest/testdata/standard_libraries/datetime/convert_date_result_format.txt
/src/robot/libraries/DateTime.py
=======================================
---
/atest/testdata/standard_libraries/datetime/convert_date_input_format.txt
Thu Jun 12 22:26:52 2014 UTC
+++
/atest/testdata/standard_libraries/datetime/convert_date_input_format.txt
Mon Jun 16 14:17:45 2014 UTC
@@ -45,7 +45,7 @@
Formatted with %f in middle
[Template] NONE
- Run Keyword If sys.version_info < (2, 6) or sys.platform == 'cli'
+ Run Keyword If sys.version_info < (2, 6) or sys.platform == 'cli'
or sys.platform.startswith('java')
... Run Keyword And Expect Error ValueError: %f directive is
supported only at the end of the format string on this Python interpreter.
... Date Conversion Should Succeed 21:45:12.123 24.04.2014
2014-04-24 21:45:12.123 %H:%M:%S.%f %d.%m.%Y
... ELSE
=======================================
---
/atest/testdata/standard_libraries/datetime/convert_date_result_format.txt
Thu Jun 12 22:26:52 2014 UTC
+++
/atest/testdata/standard_libraries/datetime/convert_date_result_format.txt
Mon Jun 16 14:17:45 2014 UTC
@@ -65,7 +65,7 @@
Formatted with %f in middle
[Template] NONE
- Run Keyword If sys.version_info < (2, 6) or sys.platform == 'cli'
+ Run Keyword If sys.version_info < (2, 6) or sys.platform == 'cli'
or sys.platform.startswith('java')
... Run Keyword And Expect Error ValueError: %f directive is
supported only at the end of the format string on this Python interpreter.
... Date Conversion Should Succeed 2014-04-24
21:45:12.123 %H:%M:%S.%f %Y-%m-%d 21:45:12.123000 2014-04-24
... ELSE
=======================================
--- /src/robot/libraries/DateTime.py Mon Jun 16 09:29:29 2014 UTC
+++ /src/robot/libraries/DateTime.py Mon Jun 16 14:17:45 2014 UTC
@@ -517,7 +517,11 @@
def _need_to_handle_f_directive(self, format):
if '%f' not in format:
return False
- return sys.version_info < (2, 6) or sys.platform == 'cli'
+ if sys.version_info < (2, 6):
+ return True
+ # https://ironpython.codeplex.com/workitem/34706
+ # http://bugs.jython.org/issue2166
+ return sys.platform == 'cli' or sys.platform.startswith('java')
def _normalize_timestamp(self, date):
ts = ''.join(d for d in date if d.isdigit())
--
---
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/d/optout.