~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:56:05 UTC
  • mfrom: (6615.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201195605-o7rl92wf6uyum3fk
(vila) Open trunk again as 2.8b1 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2012 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  bzrlib import (
 
19
from bzrlib import (
 
20
    branch as _mod_branch,
20
21
    errors,
21
22
    ui,
22
23
    tests,
29
30
    def setUp(self):
30
31
        super(TestBreakLock, self).setUp()
31
32
        self.unused_branch = self.make_branch('branch')
32
 
        self.branch = self.unused_branch.bzrdir.open_branch()
 
33
        self.branch = _mod_branch.Branch.open(self.unused_branch.base)
33
34
 
34
35
    def test_unlocked(self):
35
36
        # break lock when nothing is locked should just return
85
86
        master.lock_write()
86
87
        ui.ui_factory = ui.CannedInputUIFactory([True, True])
87
88
        try:
88
 
            self.unused_branch.break_lock()
 
89
            fresh = _mod_branch.Branch.open(self.unused_branch.base)
 
90
            fresh.break_lock()
89
91
        except NotImplementedError:
90
92
            # branch does not support break_lock
91
93
            master.unlock()