2 new revisions:

Revision: 581f823c1614
Author:   Pekka Klärck
Date:     Mon Dec 19 08:03:39 2011
Log:      oops, forgot to add this helper library earlier
http://code.google.com/p/robotframework/source/detail?r=581f823c1614

Revision: 2927b34b2075
Author:   Pekka Klärck
Date:     Mon Dec 19 08:06:38 2011
Log:      fixed test for handling invalid debug files
http://code.google.com/p/robotframework/source/detail?r=2927b34b2075

==============================================================================
Revision: 581f823c1614
Author:   Pekka Klärck
Date:     Mon Dec 19 08:03:39 2011
Log:      oops, forgot to add this helper library earlier
http://code.google.com/p/robotframework/source/detail?r=581f823c1614

Added:
 /atest/robot/output/OutputVerifierLibrary.py

=======================================
--- /dev/null
+++ /atest/robot/output/OutputVerifierLibrary.py        Mon Dec 19 08:03:39 2011
@@ -0,0 +1,15 @@
+from __future__ import with_statement
+import os
+import codecs
+
+
+def output_should_have_correct_line_separators(path):
+    with codecs.open(path, encoding='UTF-8') as infile:
+        content = infile.read()
+    content = content.replace(os.linesep, '')
+    incorrect = content.count('\n')
+    if incorrect:
+        err = AssertionError("Output '%s' has %d incorrect line separators"
+                             % (path, incorrect))
+        err.ROBOT_CONTINUE_ON_FAILURE = True
+        raise err

==============================================================================
Revision: 2927b34b2075
Author:   Pekka Klärck
Date:     Mon Dec 19 08:06:38 2011
Log:      fixed test for handling invalid debug files
http://code.google.com/p/robotframework/source/detail?r=2927b34b2075

Modified:
 /atest/robot/cli/runner/debugfile.txt
 /src/robot/output/debugfile.py

=======================================
--- /atest/robot/cli/runner/debugfile.txt       Thu Apr  8 08:11:28 2010
+++ /atest/robot/cli/runner/debugfile.txt       Mon Dec 19 08:06:38 2011
@@ -35,7 +35,7 @@
 Invalid Debugfile
     Create Directory  ${CLI OUTDIR}${/}debug.txt
Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -b debug.txt ${TESTFILE} - Check Stderr Matches Regexp \\[ ERROR \\] Opening debug file '.*debug.txt' failed and writing to debug file is disabled. Error: (IOError|FileNotFoundException): .* + Check Stderr Matches Regexp \\[ ERROR \\] Opening debug file '.*debug.txt' failed: .* Check Stdout Contains 2 critical tests, 2 passed, 0 failed\n 2 tests total, 2 passed, 0 failed

 Writing Unicode To Debugfile
=======================================
--- /src/robot/output/debugfile.py      Mon Dec 19 07:26:27 2011
+++ /src/robot/output/debugfile.py      Mon Dec 19 08:06:38 2011
@@ -25,8 +25,7 @@
     try:
         outfile = open(path, 'w')
     except EnvironmentError, err:
- LOGGER.error("Opening debug file '%s' failed and writing to debug file "
-                     "is disabled. Error: %s" % (path, err.strerror))
+ LOGGER.error("Opening debug file '%s' failed: %s" % (path, err.strerror))
         return None
     else:
         LOGGER.info('Debug file: %s' % path)

Reply via email to