~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2010-02-10 17:52:08 UTC
  • mfrom: (5021 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5023.
  • Revision ID: john@arbash-meinel.com-20100210175208-bubuwav4uqigu291
Merge bzr.dev 5021 to resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2009 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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()