~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2017-01-17 13:48:10 UTC
  • mfrom: (6615.3.6 merges)
  • mto: This revision was merged to the branch mainline in revision 6620.
  • Revision ID: v.ladeuil+lp@free.fr-20170117134810-j9p3lidfy6pfyfsc
Merge 2.7, resolving conflicts

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()