2 new revisions:
Revision: 62679911cd00
Branch: default
Author: Pekka Klärck
Date: Fri Sep 14 05:01:11 2012
Log: minor cleanup
http://code.google.com/p/robotframework/source/detail?r=62679911cd00
Revision: 4b063613c742
Branch: default
Author: Pekka Klärck
Date: Fri Sep 14 05:01:48 2012
Log: libdoc cli tests: allow different formats in printed output file
path
http://code.google.com/p/robotframework/source/detail?r=4b063613c742
==============================================================================
Revision: 62679911cd00
Branch: default
Author: Pekka Klärck
Date: Fri Sep 14 05:01:11 2012
Log: minor cleanup
http://code.google.com/p/robotframework/source/detail?r=62679911cd00
Modified:
/src/robot/libdoc.py
=======================================
--- /src/robot/libdoc.py Wed May 30 03:41:36 2012
+++ /src/robot/libdoc.py Fri Sep 14 05:01:11 2012
@@ -137,10 +137,11 @@
self.console(os.path.abspath(output))
def _get_format(self, format, output):
- format = (format if format else
os.path.splitext(output)[1][1:]).upper()
- if format in ['HTML', 'XML']:
- return format
- raise DataError("Format must be either 'HTML' or 'XML',
got '%s'." % format)
+ format = (format or os.path.splitext(output)[1][1:]).upper()
+ if format not in ['HTML', 'XML']:
+ raise DataError("Format must be either 'HTML' or 'XML',
got '%s'."
+ % format)
+ return format
def libdoc_cli(args):
==============================================================================
Revision: 4b063613c742
Branch: default
Author: Pekka Klärck
Date: Fri Sep 14 05:01:48 2012
Log: libdoc cli tests: allow different formats in printed output file
path
http://code.google.com/p/robotframework/source/detail?r=4b063613c742
Modified:
/atest/robot/libdoc/__init__.txt
/atest/robot/libdoc/cli.txt
/atest/robot/libdoc/libdoc_resource.txt
=======================================
--- /atest/robot/libdoc/__init__.txt Thu Feb 16 03:42:26 2012
+++ /atest/robot/libdoc/__init__.txt Fri Sep 14 05:01:48 2012
@@ -1,4 +1,4 @@
*** Settings ***
Resource libdoc_resource.txt
-Suite Setup Remove File ${OUTPREFIX}*
-Suite Teardown Remove File ${OUTPREFIX}*
+Suite Setup Remove Output Files
+Suite Teardown Remove Output Files
=======================================
--- /atest/robot/libdoc/cli.txt Thu May 31 02:09:09 2012
+++ /atest/robot/libdoc/cli.txt Fri Sep 14 05:01:48 2012
@@ -30,8 +30,10 @@
*** Keywords ***
Run Libdoc And Verify Created Output File
[Arguments] ${args} ${format} ${name} ${version}=
${path}=${OUTHTML}
- Run Libdoc And Verify Output ${args} ${path}
+ ${stdout} = Run Libdoc ${args}
Run Keyword ${format} Doc Should Have Been Created ${path}
${name} ${version}
+ Path to output should be in stdout ${path} ${stdout.rstrip()}
+ [Teardown] Remove Output Files
HTML Doc Should Have Been Created
[Arguments] ${path} ${name} ${version}
@@ -46,3 +48,11 @@
Set Test Variable ${libdoc}
Name Should Be ${name}
Run Keyword If "${version}" Version Should Match ${version}
+
+Path to output should be in stdout
+ [Documentation] Printed path may be in different format than
original.
+ ... IronPython seems to like 'c:\olddos~1\format~2.ext'.
+ [Arguments] ${path} ${stdout}
+ File Should Exist ${stdout}
+ Remove File ${path}
+ File Should Not Exist ${stdout}
=======================================
--- /atest/robot/libdoc/libdoc_resource.txt Wed Sep 12 15:17:39 2012
+++ /atest/robot/libdoc/libdoc_resource.txt Fri Sep 14 05:01:48 2012
@@ -111,3 +111,6 @@
${kws}= Get Elements ${LIBDOC} ${type}
${args}= Get Elements Texts ${kws[${index}]} arguments/arg
[Return] ${args}
+
+Remove Output Files
+ Remove Files ${OUTPREFIX}*