Rev 4790: Skip the assertFilenameSkipped tests on Windows. in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-win32-filename-skipped

John Arbash Meinel john at arbash-meinel.com
Sun Nov 8 04:49:16 GMT 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-win32-filename-skipped

------------------------------------------------------------
revno: 4790
revision-id: john at arbash-meinel.com-20091108044906-cjihus7io3kbtjhb
parent: pqm at pqm.ubuntu.com-20091106084512-t5ll6xywcd1bycfe
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b4-win32-filename-skipped
timestamp: Sat 2009-11-07 22:49:06 -0600
message:
  Skip the assertFilenameSkipped tests on Windows.
  
  The test checks that files with newline or carriage return are not
  added by smart add. However, those files cannot be created on win32.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_workingtree/test_smart_add.py'
--- a/bzrlib/tests/per_workingtree/test_smart_add.py	2009-09-28 02:02:30 +0000
+++ b/bzrlib/tests/per_workingtree/test_smart_add.py	2009-11-08 04:49:06 +0000
@@ -17,6 +17,7 @@
 """Test that we can use smart_add on all Tree implementations."""
 
 from cStringIO import StringIO
+import sys
 
 from bzrlib import (
     add,
@@ -53,7 +54,12 @@
 
     def assertFilenameSkipped(self, filename):
         tree = self.make_branch_and_tree('tree')
-        self.build_tree(['tree/'+filename])
+        try:
+            self.build_tree(['tree/'+filename])
+        except errors.NoSuchFile:
+            if sys.platform == 'win32':
+                raise tests.TestNotApplicable('Cannot create files named %r on'
+                    ' win32' % (filename,))
         tree.smart_add(['tree'])
         self.assertEqual(None, tree.path2id(filename))
 



More information about the bazaar-commits mailing list