/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_repository.py

  • Committer: Parth Malwankar
  • Date: 2010-05-13 06:54:21 UTC
  • mfrom: (5225 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5241.
  • Revision ID: parth.malwankar@gmail.com-20100513065421-bde255i4ga5o3oqe
merged in changes from trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
    per_repository,
48
48
    test_server,
49
49
    )
 
50
from bzrlib.tests.matchers import *
50
51
 
51
52
 
52
53
class TestRepositoryMakeBranchAndTree(per_repository.TestCaseWithRepository):
1087
1088
        repo = self.make_repository('r')
1088
1089
        # Lock the repository, then use leave_lock_in_place so that when we
1089
1090
        # unlock the repository the lock is still held on disk.
1090
 
        token = repo.lock_write()
 
1091
        token = repo.lock_write().repository_token
1091
1092
        try:
1092
1093
            if token is None:
1093
1094
                # This test does not apply, because this repository refuses lock
1107
1108
    def test_dont_leave_lock_in_place(self):
1108
1109
        repo = self.make_repository('r')
1109
1110
        # Create a lock on disk.
1110
 
        token = repo.lock_write()
 
1111
        token = repo.lock_write().repository_token
1111
1112
        try:
1112
1113
            if token is None:
1113
1114
                # This test does not apply, because this repository refuses lock
1141
1142
        repo.lock_read()
1142
1143
        repo.unlock()
1143
1144
 
 
1145
    def test_lock_read_returns_unlockable(self):
 
1146
        repo = self.make_repository('r')
 
1147
        self.assertThat(repo.lock_read, ReturnsUnlockable(repo))
 
1148
 
 
1149
    def test_lock_write_returns_unlockable(self):
 
1150
        repo = self.make_repository('r')
 
1151
        self.assertThat(repo.lock_write, ReturnsUnlockable(repo))
 
1152
 
1144
1153
 
1145
1154
class TestCaseWithComplexRepository(per_repository.TestCaseWithRepository):
1146
1155