~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-11 00:23:23 UTC
  • mfrom: (2070 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2071.
  • Revision ID: john@arbash-meinel.com-20061011002323-82ba88c293d7caff
[merge] bzr.dev 2070

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for LockDir"""
18
18
 
19
19
from cStringIO import StringIO
20
 
import os
21
20
from threading import Thread, Lock
22
21
import time
23
22
 
24
23
import bzrlib
25
24
from bzrlib import (
26
25
    config,
27
 
    errors,
28
26
    osutils,
29
 
    tests,
30
27
    )
31
28
from bzrlib.errors import (
32
29
        LockBreakMismatch,
603
600
        ld1.create()
604
601
        ld1.lock_write()
605
602
        ld1.unlock()
606
 
 
607
 
    def test_lock_permission(self):
608
 
        if not osutils.supports_posix_readonly():
609
 
            raise tests.TestSkipped('Cannot induce a permission failure')
610
 
        ld1 = self.get_lock()
611
 
        lock_path = ld1.transport.local_abspath('test_lock')
612
 
        os.mkdir(lock_path)
613
 
        osutils.make_readonly(lock_path)
614
 
        self.assertRaises(errors.PermissionDenied, ld1.attempt_lock)