Rev 3653: Fix test_case_insensitive_clash to pass on all platforms (renamed too). in http://bazaar.launchpad.net/%7Ebzr/bzr/osx_tests_fix
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Sep 8 15:50:50 BST 2008
At http://bazaar.launchpad.net/%7Ebzr/bzr/osx_tests_fix
------------------------------------------------------------
revno: 3653
revision-id: v.ladeuil+lp at free.fr-20080908145015-mqsnsc8nnabngs7c
parent: v.ladeuil+lp at free.fr-20080908143528-hak1vrw8d64tb0zq
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: osx_tests_fix
timestamp: Mon 2008-09-08 16:50:15 +0200
message:
Fix test_case_insensitive_clash to pass on all platforms (renamed too).
* bzrlib/tests/test_transform.py:
(TestTreeTransform.test_rollback_on_directory_clash): Renamed from
test_case_insensitive_clash and changed to pass on all platforms.
modified:
bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
-------------- next part --------------
=== modified file 'bzrlib/tests/test_transform.py'
--- a/bzrlib/tests/test_transform.py 2008-08-29 00:35:38 +0000
+++ b/bzrlib/tests/test_transform.py 2008-09-08 14:50:15 +0000
@@ -1162,22 +1162,28 @@
transform.cancel_creation(parent)
transform.finalize()
- def test_case_insensitive_clash(self):
- self.requireFeature(CaseInsensitiveFilesystemFeature)
+ def test_rollback_on_directory_clash(self):
+ wt = self.make_branch_and_tree('.')
+ wt.add
def tt_helper():
- wt = self.make_branch_and_tree('.')
tt = TreeTransform(wt) # TreeTransform obtains write lock
try:
- tt.new_file('foo', tt.root, 'bar')
- tt.new_file('Foo', tt.root, 'spam')
+ foo = tt.new_directory('foo', tt.root)
+ tt.new_file('bar', foo, 'foobar')
+ baz = tt.new_directory('baz', tt.root)
+ tt.new_file('qux', baz, 'quux')
+ # Ask for a rename 'foo' -> 'baz'
+ tt.adjust_path('baz', tt.root, foo)
# Lie to tt that we've already resolved all conflicts.
tt.apply(no_conflicts=True)
except:
wt.unlock()
raise
+ # It will fail the renaming because the target directory is not empty
+ # (but raise FileExists anyway).
err = self.assertRaises(errors.FileExists, tt_helper)
self.assertContainsRe(str(err),
- "^File exists: .+/foo")
+ "^File exists: .+/baz")
def test_two_directories_clash(self):
def tt_helper():
@@ -1186,6 +1192,7 @@
try:
foo_1 = tt.new_directory('foo', tt.root)
tt.new_directory('bar', foo_1)
+ # Adding the same directory with a different content
foo_2 = tt.new_directory('foo', tt.root)
tt.new_directory('baz', foo_2)
# Lie to tt that we've already resolved all conflicts.
@@ -1204,6 +1211,7 @@
try:
foo_1 = tt.new_directory('foo', tt.root)
tt.new_directory('bar', foo_1)
+ # Adding the same directory with a different content
foo_2 = tt.new_directory('foo', tt.root)
tt.new_directory('baz', foo_2)
# Lie to tt that we've already resolved all conflicts.
More information about the bazaar-commits
mailing list