/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_lockable_files.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 18:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521181028-zn04pdfw0od9hfj3
Rename brzlib => breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
import brzlib
18
 
from brzlib import (
 
17
import breezy
 
18
from breezy import (
19
19
    errors,
20
20
    lockdir,
21
21
    osutils,
22
22
    transport,
23
23
    )
24
 
from brzlib.lockable_files import LockableFiles, TransportLock
25
 
from brzlib.tests import (
 
24
from breezy.lockable_files import LockableFiles, TransportLock
 
25
from breezy.tests import (
26
26
    TestCaseInTempDir,
27
27
    TestNotApplicable,
28
28
    )
29
 
from brzlib.tests.test_smart import TestCaseWithSmartMedium
30
 
from brzlib.tests.test_transactions import DummyWeave
31
 
from brzlib.transactions import (PassThroughTransaction,
 
29
from breezy.tests.test_smart import TestCaseWithSmartMedium
 
30
from breezy.tests.test_transactions import DummyWeave
 
31
from breezy.transactions import (PassThroughTransaction,
32
32
                                 ReadOnlyTransaction,
33
33
                                 WriteTransaction,
34
34
                                 )
76
76
            self.lockable.unlock()
77
77
            raise TestNotApplicable("%r is not breakable" % (self.lockable,))
78
78
        l2 = self.get_lockable()
79
 
        orig_factory = brzlib.ui.ui_factory
 
79
        orig_factory = breezy.ui.ui_factory
80
80
        # silent ui - no need for stdout
81
 
        brzlib.ui.ui_factory = brzlib.ui.CannedInputUIFactory([True])
 
81
        breezy.ui.ui_factory = breezy.ui.CannedInputUIFactory([True])
82
82
        try:
83
83
            l2.break_lock()
84
84
        finally:
85
 
            brzlib.ui.ui_factory = orig_factory
 
85
            breezy.ui.ui_factory = orig_factory
86
86
        try:
87
87
            l2.lock_write()
88
88
            l2.unlock()
346
346
 
347
347
    def get_lockable(self):
348
348
        # getting a new lockable involves opening a new instance of the branch
349
 
        branch = brzlib.branch.Branch.open(self.get_url('foo'))
 
349
        branch = breezy.branch.Branch.open(self.get_url('foo'))
350
350
        self.addCleanup(branch.bzrdir.transport.disconnect)
351
351
        return branch.control_files