Rev 4804: 2.1.0b4-win32-trace was accepted in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-dev

John Arbash Meinel john at arbash-meinel.com
Mon Nov 16 20:12:00 GMT 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-dev

------------------------------------------------------------
revno: 4804 [merge]
revision-id: john at arbash-meinel.com-20091116201155-13v35xwa5iej5z0b
parent: john at arbash-meinel.com-20091116201114-75d355fdrycnii97
parent: john at arbash-meinel.com-20091108190700-f0sfia3kjtdgqjg8
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b4-dev
timestamp: Mon 2009-11-16 14:11:55 -0600
message:
  2.1.0b4-win32-trace was accepted
modified:
  bzrlib/tests/test_trace.py     testtrace.py-20051110225523-a21117fc7a07eeff
-------------- next part --------------
=== modified file 'bzrlib/tests/test_trace.py'
--- a/bzrlib/tests/test_trace.py	2009-09-03 02:59:56 +0000
+++ b/bzrlib/tests/test_trace.py	2009-11-08 19:07:00 +0000
@@ -84,11 +84,12 @@
     def test_format_os_error(self):
         try:
             os.rmdir('nosuchfile22222')
-        except OSError:
-            pass
+        except OSError, e:
+            e_str = str(e)
         msg = _format_exception()
-        self.assertContainsRe(msg,
-            r'^bzr: ERROR: \[Errno .*\] No such file.*nosuchfile22222')
+        # Linux seems to give "No such file" but Windows gives "The system
+        # cannot find the file specified".
+        self.assertEqual('bzr: ERROR: %s\n' % (e_str,), msg)
 
     def test_format_io_error(self):
         try:
@@ -96,7 +97,10 @@
         except IOError:
             pass
         msg = _format_exception()
-        self.assertContainsRe(msg, r'^bzr: ERROR: \[Errno .*\] No such file.*nosuchfile')
+        # Even though Windows and Linux differ for 'os.rmdir', they both give
+        # 'No such file' for open()
+        self.assertContainsRe(msg,
+            r'^bzr: ERROR: \[Errno .*\] No such file.*nosuchfile')
 
     def test_format_unicode_error(self):
         try:
@@ -268,7 +272,7 @@
     def test_log_rollover(self):
         temp_log_name = 'test-log'
         trace_file = open(temp_log_name, 'at')
-        trace_file.write('test_log_rollover padding\n' * 1000000)
+        trace_file.writelines(['test_log_rollover padding\n'] * 200000)
         trace_file.close()
         _rollover_trace_maybe(temp_log_name)
         # should have been rolled over



More information about the bazaar-commits mailing list