Rev 5027: Fix imports in per_branch/test_pull.py. in file:///home/vila/src/bzr/cleanup/test-imports/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Feb 8 08:55:09 GMT 2010
At file:///home/vila/src/bzr/cleanup/test-imports/
------------------------------------------------------------
revno: 5027
revision-id: v.ladeuil+lp at free.fr-20100208085509-s6rrgjelnwmd3nzw
parent: v.ladeuil+lp at free.fr-20100208085026-e9a4z2wr72vqlm66
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: test-imports
timestamp: Mon 2010-02-08 09:55:09 +0100
message:
Fix imports in per_branch/test_pull.py.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_branch/test_pull.py'
--- a/bzrlib/tests/per_branch/test_pull.py 2009-07-10 05:49:34 +0000
+++ b/bzrlib/tests/per_branch/test_pull.py 2010-02-08 08:55:09 +0000
@@ -18,15 +18,17 @@
import os
-from bzrlib.branch import Branch, BzrBranchFormat5
-from bzrlib.bzrdir import BzrDir
-from bzrlib import errors
-from bzrlib.memorytree import MemoryTree
-from bzrlib.revision import NULL_REVISION
-from bzrlib.tests.per_branch.test_branch import TestCaseWithBranch
-
-
-class TestPull(TestCaseWithBranch):
+from bzrlib import (
+ branch,
+ bzrdir,
+ errors,
+ memorytree,
+ revision,
+ )
+from bzrlib.tests import per_branch
+
+
+class TestPull(per_branch.TestCaseWithBranch):
def test_pull_convergence_simple(self):
# when revisions are pulled, the left-most accessible parents must
@@ -145,11 +147,11 @@
tree_a.branch.revision_history())
-class TestPullHook(TestCaseWithBranch):
+class TestPullHook(per_branch.TestCaseWithBranch):
def setUp(self):
self.hook_calls = []
- TestCaseWithBranch.setUp(self)
+ super(TestPullHook, self).setUp()
def capture_post_pull_hook(self, result):
"""Capture post pull hook calls to self.hook_calls.
@@ -173,14 +175,14 @@
def test_post_pull_empty_history(self):
target = self.make_branch('target')
source = self.make_branch('source')
- Branch.hooks.install_named_hook('post_pull',
- self.capture_post_pull_hook, None)
+ branch.Branch.hooks.install_named_hook(
+ 'post_pull', self.capture_post_pull_hook, None)
target.pull(source)
# with nothing there we should still get a notification, and
# have both branches locked at the notification time.
self.assertEqual([
- ('post_pull', source, None, target.base, 0, NULL_REVISION,
- 0, NULL_REVISION, True, None, True)
+ ('post_pull', source, None, target.base, 0, revision.NULL_REVISION,
+ 0, revision.NULL_REVISION, True, None, True)
],
self.hook_calls)
@@ -199,17 +201,18 @@
# remotebranches can't be bound. Let's instead make a new local
# branch of the default type, which does allow binding.
# See https://bugs.launchpad.net/bzr/+bug/112020
- local = BzrDir.create_branch_convenience('local2')
+ local = bzrdir.BzrDir.create_branch_convenience('local2')
local.bind(target)
source = self.make_branch('source')
- Branch.hooks.install_named_hook('post_pull',
- self.capture_post_pull_hook, None)
+ branch.Branch.hooks.install_named_hook(
+ 'post_pull', self.capture_post_pull_hook, None)
local.pull(source)
# with nothing there we should still get a notification, and
# have both branches locked at the notification time.
self.assertEqual([
- ('post_pull', source, local.base, target.base, 0, NULL_REVISION,
- 0, NULL_REVISION, True, True, True)
+ ('post_pull', source, local.base, target.base, 0,
+ revision.NULL_REVISION, 0, revision.NULL_REVISION,
+ True, True, True)
],
self.hook_calls)
@@ -220,10 +223,10 @@
rev1 = target.commit('rev 1')
target.unlock()
sourcedir = target.bzrdir.clone(self.get_url('source'))
- source = MemoryTree.create_on_branch(sourcedir.open_branch())
+ source = memorytree.MemoryTree.create_on_branch(sourcedir.open_branch())
rev2 = source.commit('rev 2')
- Branch.hooks.install_named_hook('post_pull',
- self.capture_post_pull_hook, None)
+ branch.Branch.hooks.install_named_hook(
+ 'post_pull', self.capture_post_pull_hook, None)
target.branch.pull(source.branch)
# with nothing there we should still get a notification, and
# have both branches locked at the notification time.
More information about the bazaar-commits
mailing list