~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-28 08:13:58 UTC
  • mfrom: (1957.1.17 wait-on-lock)
  • Revision ID: pqm@pqm.ubuntu.com-20060928081358-b8dfad24b0625b94
(jam) tests that expect LockContention should timeout sooner

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import os
19
19
 
20
20
import bzrlib
21
 
from bzrlib import errors
22
 
from bzrlib.tests import TestCaseWithTransport
 
21
from bzrlib import (
 
22
    errors,
 
23
    lockdir,
 
24
    )
23
25
from bzrlib.branch import Branch
24
26
from bzrlib.bzrdir import BzrDir, BzrDirMetaFormat1
25
 
from bzrlib.workingtree import WorkingTree
26
27
from bzrlib.commit import Commit, NullCommitReporter
27
28
from bzrlib.config import BranchConfig
28
29
from bzrlib.errors import (PointlessCommit, BzrError, SigningFailed, 
29
30
                           LockContention)
 
31
from bzrlib.tests import TestCaseWithTransport
 
32
from bzrlib.workingtree import WorkingTree
30
33
 
31
34
 
32
35
# TODO: Test commit with some added, and added-but-missing files
408
411
        bound = master.sprout('bound')
409
412
        wt = bound.open_workingtree()
410
413
        wt.branch.set_bound_location(os.path.realpath('master'))
 
414
 
 
415
        orig_default = lockdir._DEFAULT_TIMEOUT_SECONDS
411
416
        master_branch.lock_write()
412
417
        try:
 
418
            lockdir._DEFAULT_TIMEOUT_SECONDS = 1
413
419
            self.assertRaises(LockContention, wt.commit, 'silly')
414
420
        finally:
 
421
            lockdir._DEFAULT_TIMEOUT_SECONDS = orig_default
415
422
            master_branch.unlock()
416
423
 
417
424
    def test_commit_bound_merge(self):