~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_break_lock.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-08 10:14:23 UTC
  • mfrom: (5013.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100208101423-q81doa9rua7c3x6t
(vila) Fix a bunch of test imports

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for branch break-lock behaviour."""
18
18
 
19
 
from cStringIO import StringIO
20
 
 
21
19
from  bzrlib import (
22
20
    errors,
23
21
    ui,
 
22
    tests,
24
23
    )
25
 
from bzrlib.tests import TestCase, TestCaseWithTransport, TestNotApplicable
26
 
from bzrlib.tests.per_branch.test_branch import TestCaseWithBranch
27
 
 
28
 
 
29
 
class TestBreakLock(TestCaseWithBranch):
 
24
from bzrlib.tests import per_branch
 
25
 
 
26
 
 
27
class TestBreakLock(per_branch.TestCaseWithBranch):
30
28
 
31
29
    def setUp(self):
32
30
        super(TestBreakLock, self).setUp()
46
44
        token = self.branch.repository.lock_write()
47
45
        if token is None:
48
46
            self.branch.repository.unlock()
49
 
            raise TestNotApplicable('Repository does not use physical locks.')
 
47
            raise tests.TestNotApplicable(
 
48
                'Repository does not use physical locks.')
50
49
        self.branch.repository.leave_lock_in_place()
51
50
        self.branch.repository.unlock()
52
51
        other_instance = self.branch.repository.bzrdir.open_repository()
53
52
        if not other_instance.get_physical_lock_status():
54
 
            raise TestNotApplicable("Repository does not lock persistently.")
 
53
            raise tests.TestNotApplicable(
 
54
                'Repository does not lock persistently.')
55
55
        ui.ui_factory = ui.CannedInputUIFactory([True])
56
56
        try:
57
57
            self.unused_branch.break_lock()