Rev 4297: Fix up test usable of _set_parent_location on unlocked branches. in http://people.ubuntu.com/~robertc/baz2.0/pending/push.roundtrips

Robert Collins robertc at robertcollins.net
Wed Apr 15 04:45:27 BST 2009


At http://people.ubuntu.com/~robertc/baz2.0/pending/push.roundtrips

------------------------------------------------------------
revno: 4297
revision-id: robertc at robertcollins.net-20090415034524-ivssdg89z2lzs9pw
parent: robertc at robertcollins.net-20090415032048-u7ccp2v2ee14ebjt
committer: Robert Collins <robertc at robertcollins.net>
branch nick: push.roundtrips
timestamp: Wed 2009-04-15 13:45:24 +1000
message:
  Fix up test usable of _set_parent_location on unlocked branches.
=== modified file 'bzrlib/tests/branch_implementations/test_parent.py'
--- a/bzrlib/tests/branch_implementations/test_parent.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/branch_implementations/test_parent.py	2009-04-15 03:45:24 +0000
@@ -71,7 +71,9 @@
             #       paths as well? Nobody has complained about it.
             pass
         else:
+            b.lock_write()
             b._set_parent_location('/local/abs/path')
+            b.unlock()
             self.assertEqual('file:///local/abs/path', b.get_parent())
 
     def test_get_invalid_parent(self):
@@ -83,7 +85,9 @@
         # Force the relative path to be something invalid
         # This should attempt to go outside the filesystem
         path = ('../'*(n_dirs+5)) + 'foo'
+        b.lock_write()
         b._set_parent_location(path)
+        b.unlock()
 
         # With an invalid branch parent, just return None
         self.assertRaises(bzrlib.errors.InaccessibleParent, b.get_parent)

=== modified file 'bzrlib/tests/test_smart.py'
--- a/bzrlib/tests/test_smart.py	2009-04-15 02:07:35 +0000
+++ b/bzrlib/tests/test_smart.py	2009-04-15 03:45:24 +0000
@@ -796,7 +796,9 @@
 
     def test_set_parent_none(self):
         branch = self.make_branch('base', format="1.9")
+        branch.lock_write()
         branch._set_parent_location('foo')
+        branch.unlock()
         request = smart.branch.SmartServerBranchRequestSetParentLocation(
             self.get_transport())
         branch_token = branch.lock_write()




More information about the bazaar-commits mailing list