Rev 5015: (vila)(trivial) Fix imports in test_smart_add.py in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Feb 8 10:46:40 GMT 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5015 [merge]
revision-id: pqm at pqm.ubuntu.com-20100208104639-3gzaq1d5snphj178
parent: pqm at pqm.ubuntu.com-20100208101423-q81doa9rua7c3x6t
parent: v.ladeuil+lp at free.fr-20100208101211-i78wdac0v9tqy8ke
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2010-02-08 10:46:39 +0000
message:
  (vila)(trivial) Fix imports in test_smart_add.py
modified:
  bzrlib/tests/per_workingtree/test_smart_add.py test_smart_add.py-20070215175752-9s5mxoz8aqpd80fm-1
  bzrlib/tests/test_smart_add.py test_smart_add.py-20050824235919-c60dcdb0c8e999ce
=== modified file 'bzrlib/tests/per_workingtree/test_smart_add.py'
--- a/bzrlib/tests/per_workingtree/test_smart_add.py	2009-11-08 04:49:06 +0000
+++ b/bzrlib/tests/per_workingtree/test_smart_add.py	2010-02-08 10:00:04 +0000
@@ -27,15 +27,13 @@
     tests,
     workingtree,
     )
-from bzrlib.add import (
-    AddAction,
-    AddFromBaseAction,
+from bzrlib.tests import (
+    test_smart_add,
+    per_workingtree,
     )
-from bzrlib.tests.test_smart_add import AddCustomIDAction
-from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
-
-
-class TestSmartAddTree(TestCaseWithWorkingTree):
+
+
+class TestSmartAddTree(per_workingtree.TestCaseWithWorkingTree):
 
     def test_single_file(self):
         tree = self.make_branch_and_tree('tree')
@@ -205,7 +203,8 @@
 
     def test_custom_ids(self):
         sio = StringIO()
-        action = AddCustomIDAction(to_file=sio, should_print=True)
+        action = test_smart_add.AddCustomIDAction(to_file=sio,
+                                                  should_print=True)
         self.build_tree(['file1', 'dir1/', 'dir1/file2'])
 
         wt = self.make_branch_and_tree('.')

=== modified file 'bzrlib/tests/test_smart_add.py'
--- a/bzrlib/tests/test_smart_add.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/test_smart_add.py	2010-02-08 09:50:58 +0000
@@ -16,16 +16,15 @@
 
 from cStringIO import StringIO
 
-from bzrlib import osutils
-from bzrlib.add import (
-    AddAction,
-    AddFromBaseAction,
+from bzrlib import (
+    add,
+    inventory,
+    osutils,
+    tests,
     )
-from bzrlib.tests import TestCase, TestCaseWithTransport
-from bzrlib.inventory import Inventory
-
-
-class AddCustomIDAction(AddAction):
+
+
+class AddCustomIDAction(add.AddAction):
 
     def __call__(self, inv, parent_ie, path, kind):
         # The first part just logs if appropriate
@@ -39,7 +38,7 @@
         return file_id
 
 
-class TestAddFrom(TestCaseWithTransport):
+class TestAddFrom(tests.TestCaseWithTransport):
     """Tests for AddFromBaseAction"""
 
     def make_base_tree(self):
@@ -60,9 +59,9 @@
         try:
             new_tree.lock_write()
             try:
-                action = AddFromBaseAction(base_tree, base_path,
-                                           to_file=to_file,
-                                           should_print=should_print)
+                action = add.AddFromBaseAction(base_tree, base_path,
+                                               to_file=to_file,
+                                               should_print=should_print)
                 new_tree.smart_add(file_list, action=action)
             finally:
                 new_tree.unlock()
@@ -144,7 +143,7 @@
         self.failIf(a_id in self.base_tree)
 
 
-class TestAddActions(TestCase):
+class TestAddActions(tests.TestCase):
 
     def test_quiet(self):
         self.run_action("")
@@ -153,11 +152,10 @@
         self.run_action("adding path\n")
 
     def run_action(self, output):
-        from bzrlib.add import AddAction
         from bzrlib.mutabletree import _FastPath
-        inv = Inventory()
+        inv = inventory.Inventory()
         stdout = StringIO()
-        action = AddAction(to_file=stdout, should_print=bool(output))
+        action = add.AddAction(to_file=stdout, should_print=bool(output))
 
         self.apply_redirected(None, stdout, None, action, inv, None,
             _FastPath('path'), 'file')




More information about the bazaar-commits mailing list