Rev 5030: Fix imports in per_branch/test_tags.py. in file:///home/vila/src/bzr/cleanup/test-imports/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Feb 8 09:05:44 GMT 2010


At file:///home/vila/src/bzr/cleanup/test-imports/

------------------------------------------------------------
revno: 5030
revision-id: v.ladeuil+lp at free.fr-20100208090543-r1k3nbnwfmhqjm6q
parent: v.ladeuil+lp at free.fr-20100208090233-6xv6j62hhwfa6wyi
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: test-imports
timestamp: Mon 2010-02-08 10:05:43 +0100
message:
  Fix imports in per_branch/test_tags.py.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_branch/test_tags.py'
--- a/bzrlib/tests/per_branch/test_tags.py	2009-07-10 10:46:00 +0000
+++ b/bzrlib/tests/per_branch/test_tags.py	2010-02-08 09:05:43 +0000
@@ -20,29 +20,26 @@
 1:1 with Branch implementations so can be tested from here.
 """
 
-import os
-import re
-import sys
-
-import bzrlib
-from bzrlib import bzrdir, errors, repository
-from bzrlib.branch import Branch, needs_read_lock, needs_write_lock
-from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
-from bzrlib.trace import mutter
-from bzrlib.workingtree import WorkingTree
-
-from bzrlib.tests.per_branch.test_branch import TestCaseWithBranch
-
-
-class TestBranchTags(TestCaseWithBranch):
+from bzrlib import (
+    branch,
+    bzrdir,
+    errors,
+    repository,
+    tests,
+    )
+from bzrlib.tests import per_branch
+
+
+class TestBranchTags(per_branch.TestCaseWithBranch):
 
     def setUp(self):
-        TestCaseWithBranch.setUp(self)
+        super(TestBranchTags, self).setUp()
         # formats that don't support tags can skip the rest of these
         # tests...
         branch = self.make_branch('probe')
         if not branch._format.supports_tags():
-            raise TestSkipped("format %s doesn't support tags" % branch._format)
+            raise tests.TestSkipped(
+                "format %s doesn't support tags" % branch._format)
 
     def test_tags_initially_empty(self):
         b = self.make_branch('b')
@@ -54,7 +51,7 @@
         b.tags.set_tag('tag-name', 'target-revid-1')
         b.tags.set_tag('other-name', 'target-revid-2')
         # then reopen the branch and see they're still there
-        b = Branch.open('b')
+        b = branch.Branch.open('b')
         self.assertEqual(b.tags.get_tag_dict(),
             {'tag-name': 'target-revid-1',
              'other-name': 'target-revid-2',
@@ -71,7 +68,7 @@
         b.tags.set_tag('tag-name', 'target-revid-1')
         b.tags.set_tag('other-name', 'target-revid-2')
         # then reopen the branch and check reverse map id->tags list
-        b = Branch.open('b')
+        b = branch.Branch.open('b')
         self.assertEqual(b.tags.get_reverse_tag_dict(),
             {'target-revid-1': ['tag-name'],
              'target-revid-2': ['other-name'],
@@ -147,15 +144,15 @@
         b1.tags.merge_to(b2.tags)
 
 
-class TestUnsupportedTags(TestCaseWithBranch):
+class TestUnsupportedTags(per_branch.TestCaseWithBranch):
     """Formats that don't support tags should give reasonable errors."""
 
     def setUp(self):
-        TestCaseWithBranch.setUp(self)
+        super(TestUnsupportedTags, self).setUp()
         branch = self.make_branch('probe')
         if branch._format.supports_tags():
-            raise TestSkipped("Format %s declares that tags are supported"
-                              % branch._format)
+            raise tests.TestSkipped("Format %s declares that tags are supported"
+                                    % branch._format)
             # it's covered by TestBranchTags
 
     def test_tag_methods_raise(self):



More information about the bazaar-commits mailing list