~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockable_files.py

  • Committer: Martin Pool
  • Date: 2006-03-06 04:15:36 UTC
  • mto: This revision was merged to the branch mainline in revision 1593.
  • Revision ID: mbp@sourcefrog.net-20060306041536-a1643b5f998c23a3
New LockableFiles.create_lock() method

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
        transport.put('.bzr/my-lock', StringIO(''))
102
102
        sub_transport = transport.clone('.bzr')
103
103
        self.lockable = LockableFiles(sub_transport, 'my-lock')
 
104
 
104
105
        
105
106
 
106
107
class TestLockableFiles_LockDir(TestCaseInTempDir,
120
121
        ## self.assertIsInstance(self.lockable, LockableFiles)
121
122
        ## self.assertIsInstance(self.lockable._lock_strategy,
122
123
                              ## LockDirStrategy)
 
124
 
 
125
    def test_lock_created(self):
 
126
        transport = get_transport('.')
 
127
        lockable = LockableFiles(transport, 'my-lock', LockDir)
 
128
        lockable.create_lock()
 
129
        self.assertTrue(transport.has('my-lock'))
 
130
        lockable.lock_write()
 
131
        self.assertTrue(transport.has('my-lock/held/info'))
 
132
        lockable.unlock()
 
133