Rev 3027: Make test_smart use specific formats as needed to exercise locked and unlocked repositories. in http://people.ubuntu.com/~robertc/baz2.0/pack.read-locks

Robert Collins robertc at robertcollins.net
Mon Nov 26 03:36:36 GMT 2007


At http://people.ubuntu.com/~robertc/baz2.0/pack.read-locks

------------------------------------------------------------
revno: 3027
revision-id:robertc at robertcollins.net-20071126033630-nvz32vtouqcksjdy
parent: robertc at robertcollins.net-20071126031158-0jhxvgtik27maw29
committer: Robert Collins <robertc at robertcollins.net>
branch nick: pack.read-locks
timestamp: Mon 2007-11-26 14:36:30 +1100
message:
  Make test_smart use specific formats as needed to exercise locked and unlocked repositories.
modified:
  bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
=== modified file 'bzrlib/tests/test_smart.py'
--- a/bzrlib/tests/test_smart.py	2007-10-19 05:38:36 +0000
+++ b/bzrlib/tests/test_smart.py	2007-11-26 03:36:30 +0000
@@ -17,7 +17,9 @@
 """Tests for the smart wire/domain protocol.
 
 This module contains tests for the domain-level smart requests and responses,
-such as the 'Branch.lock_write' request.
+such as the 'Branch.lock_write' request. Many of these use specific disk
+formats to exercise calls that only make sense for formats with specific
+properties.
 
 Tests for low-level protocol encoding are found in test_smart_transport.
 """
@@ -378,7 +380,7 @@
     def test_lock_write_on_unlocked_branch(self):
         backing = self.get_transport()
         request = smart.branch.SmartServerBranchRequestLockWrite(backing)
-        branch = self.make_branch('.')
+        branch = self.make_branch('.', format='knit')
         repository = branch.repository
         response = request.execute(backing.local_abspath(''))
         branch_nonce = branch.control_files._lock.peek().get('nonce')
@@ -405,7 +407,7 @@
     def test_lock_write_with_tokens_on_locked_branch(self):
         backing = self.get_transport()
         request = smart.branch.SmartServerBranchRequestLockWrite(backing)
-        branch = self.make_branch('.')
+        branch = self.make_branch('.', format='knit')
         branch_token = branch.lock_write()
         repo_token = branch.repository.lock_write()
         branch.repository.unlock()
@@ -420,7 +422,7 @@
     def test_lock_write_with_mismatched_tokens_on_locked_branch(self):
         backing = self.get_transport()
         request = smart.branch.SmartServerBranchRequestLockWrite(backing)
-        branch = self.make_branch('.')
+        branch = self.make_branch('.', format='knit')
         branch_token = branch.lock_write()
         repo_token = branch.repository.lock_write()
         branch.repository.unlock()
@@ -435,7 +437,7 @@
     def test_lock_write_on_locked_repo(self):
         backing = self.get_transport()
         request = smart.branch.SmartServerBranchRequestLockWrite(backing)
-        branch = self.make_branch('.')
+        branch = self.make_branch('.', format='knit')
         branch.repository.lock_write()
         branch.repository.leave_lock_in_place()
         branch.repository.unlock()
@@ -462,7 +464,7 @@
     def test_unlock_on_locked_branch_and_repo(self):
         backing = self.get_transport()
         request = smart.branch.SmartServerBranchRequestUnlock(backing)
-        branch = self.make_branch('.')
+        branch = self.make_branch('.', format='knit')
         # Lock the branch
         branch_token = branch.lock_write()
         repo_token = branch.repository.lock_write()
@@ -485,7 +487,7 @@
     def test_unlock_on_unlocked_branch_unlocked_repo(self):
         backing = self.get_transport()
         request = smart.branch.SmartServerBranchRequestUnlock(backing)
-        branch = self.make_branch('.')
+        branch = self.make_branch('.', format='knit')
         response = request.execute(
             backing.local_abspath(''), 'branch token', 'repo token')
         self.assertEqual(
@@ -494,7 +496,7 @@
     def test_unlock_on_unlocked_branch_locked_repo(self):
         backing = self.get_transport()
         request = smart.branch.SmartServerBranchRequestUnlock(backing)
-        branch = self.make_branch('.')
+        branch = self.make_branch('.', format='knit')
         # Lock the repository.
         repo_token = branch.repository.lock_write()
         branch.repository.leave_lock_in_place()
@@ -690,7 +692,7 @@
     def test_lock_write_on_unlocked_repo(self):
         backing = self.get_transport()
         request = smart.repository.SmartServerRepositoryLockWrite(backing)
-        repository = self.make_repository('.')
+        repository = self.make_repository('.', format='knit')
         response = request.execute(backing.local_abspath(''))
         nonce = repository.control_files._lock.peek().get('nonce')
         self.assertEqual(SmartServerResponse(('ok', nonce)), response)
@@ -702,7 +704,7 @@
     def test_lock_write_on_locked_repo(self):
         backing = self.get_transport()
         request = smart.repository.SmartServerRepositoryLockWrite(backing)
-        repository = self.make_repository('.')
+        repository = self.make_repository('.', format='knit')
         repository.lock_write()
         repository.leave_lock_in_place()
         repository.unlock()
@@ -713,7 +715,7 @@
     def test_lock_write_on_readonly_transport(self):
         backing = self.get_readonly_transport()
         request = smart.repository.SmartServerRepositoryLockWrite(backing)
-        repository = self.make_repository('.')
+        repository = self.make_repository('.', format='knit')
         response = request.execute('')
         self.assertFalse(response.is_successful())
         self.assertEqual('LockFailed', response.args[0])
@@ -728,7 +730,7 @@
     def test_unlock_on_locked_repo(self):
         backing = self.get_transport()
         request = smart.repository.SmartServerRepositoryUnlock(backing)
-        repository = self.make_repository('.')
+        repository = self.make_repository('.', format='knit')
         token = repository.lock_write()
         repository.leave_lock_in_place()
         repository.unlock()
@@ -744,7 +746,7 @@
     def test_unlock_on_unlocked_repo(self):
         backing = self.get_transport()
         request = smart.repository.SmartServerRepositoryUnlock(backing)
-        repository = self.make_repository('.')
+        repository = self.make_repository('.', format='knit')
         response = request.execute(backing.local_abspath(''), 'some token')
         self.assertEqual(
             SmartServerResponse(('TokenMismatch',)), response)



More information about the bazaar-commits mailing list