~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

MergeĀ lp:bzr/2.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009, 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
25
25
    )
26
26
from bzrlib.branch import Branch
27
27
from bzrlib.bzrdir import BzrDir
28
 
from bzrlib.tests.blackbox import ExternalBase
29
 
 
30
 
 
31
 
class TestBreakLock(ExternalBase):
 
28
from bzrlib.tests import TestCaseWithTransport
 
29
 
 
30
 
 
31
class TestBreakLock(TestCaseWithTransport):
32
32
 
33
33
    # General principal for break-lock: All the elements that might be locked
34
34
    # by a bzr operation on PATH, are candidates that break-lock may unlock.
60
60
        local_branch.bind(self.master_branch)
61
61
        checkoutdir = bzrlib.bzrdir.BzrDir.create('checkout')
62
62
        bzrlib.branch.BranchReferenceFormat().initialize(
63
 
            checkoutdir, local_branch)
 
63
            checkoutdir, target_branch=local_branch)
64
64
        self.wt = checkoutdir.create_workingtree()
65
65
 
66
66
    def test_break_lock_help(self):
93
93
        self.assertRaises(errors.LockBroken, self.master_branch.unlock)
94
94
 
95
95
 
96
 
class TestBreakLockOldBranch(ExternalBase):
 
96
class TestBreakLockOldBranch(TestCaseWithTransport):
97
97
 
98
98
    def test_break_lock_format_5_bzrdir(self):
99
99
        # break lock on a format 5 bzrdir should just return