[Buildbot-commits] buildbot/buildbot/test test_slavecommand.py,1.11,1.12

Brian Warner warner at users.sourceforge.net
Tue Apr 26 18:45:55 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32356/buildbot/test

Modified Files:
	test_slavecommand.py 
Log Message:
(Shell.checkOutput): replace any "\n" in the expected output with the
platform-specific line separator. Make this separator "\r\n" on PTYs under
unix, they seem to do that and I don't know why


Index: test_slavecommand.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- test_slavecommand.py	24 Apr 2005 21:30:25 -0000	1.11
+++ test_slavecommand.py	26 Apr 2005 18:45:53 -0000	1.12
@@ -10,7 +10,7 @@
     import sys
     startLogging(sys.stdout)
 
-import re, time, sys
+import os, re, time, sys
 import signal
 
 from buildbot.slave.commands import SlaveShellCommand
@@ -107,10 +107,13 @@
         @type  expected: list of (streamname, contents) tuples
         @param expected: the expected output
         """
+        expected_linesep = os.linesep
         if self.usePTY:
             # PTYs change the line ending. I'm not sure why.
-            expected = [(stream, contents.replace("\n", "\r\n", 1000))
-                        for (stream, contents) in expected]
+            expected_linesep = "\r\n"
+        expected = [(stream, contents.replace("\n", expected_linesep, 1000))
+                    for (stream, contents) in expected]
+        if self.usePTY:
             # PTYs merge stdout+stderr into a single stream
             expected = [('stdout', contents)
                         for (stream, contents) in expected]





More information about the Commits mailing list