Rev 5825: (jelmer) Skip per_tree tests that are InventoryTree-specific if they're run in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed May 4 20:44:18 UTC 2011


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

------------------------------------------------------------
revno: 5825 [merge]
revision-id: pqm at pqm.ubuntu.com-20110504204414-j893hspmx3k1rki4
parent: pqm at pqm.ubuntu.com-20110504195526-65o4yhqx8sgn4isv
parent: jelmer at samba.org-20110420145820-r3hvkd8c04zh5igr
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2011-05-04 20:44:14 +0000
message:
  (jelmer) Skip per_tree tests that are InventoryTree-specific if they're run
   against non-inventory trees. (Jelmer Vernooij)
modified:
  bzrlib/tests/per_tree/test_inv.py test_inv.py-20070312023226-0cdvk5uwhutis9vg-1
=== modified file 'bzrlib/tests/per_tree/test_inv.py'
--- a/bzrlib/tests/per_tree/test_inv.py	2011-04-09 21:00:33 +0000
+++ b/bzrlib/tests/per_tree/test_inv.py	2011-04-20 14:58:20 +0000
@@ -25,6 +25,7 @@
     )
 from bzrlib.mutabletree import MutableTree
 from bzrlib.tests import TestSkipped
+from bzrlib.tree import InventoryTree
 from bzrlib.transform import _PreviewTree
 from bzrlib.uncommit import uncommit
 
@@ -136,32 +137,49 @@
 
     def test_canonical_path(self):
         work_tree = self._make_canonical_test_tree()
+        if not isinstance(work_tree, InventoryTree):
+            raise tests.TestNotApplicable(
+                "test not applicable on non-inventory tests")
         self.assertEqual('dir/file',
                          work_tree.get_canonical_inventory_path('Dir/File'))
 
     def test_canonical_path_before_commit(self):
         work_tree = self._make_canonical_test_tree(False)
-        # note: not committed.
+        if not isinstance(work_tree, InventoryTree):
+            raise tests.TestNotApplicable(
+                "test not applicable on non-inventory tests")        # note: not committed.
         self.assertEqual('dir/file',
                          work_tree.get_canonical_inventory_path('Dir/File'))
 
     def test_canonical_path_dir(self):
         # check it works when asked for just the directory portion.
         work_tree = self._make_canonical_test_tree()
+        if not isinstance(work_tree, InventoryTree):
+            raise tests.TestNotApplicable(
+                "test not applicable on non-inventory tests")
         self.assertEqual('dir', work_tree.get_canonical_inventory_path('Dir'))
 
     def test_canonical_path_root(self):
         work_tree = self._make_canonical_test_tree()
+        if not isinstance(work_tree, InventoryTree):
+            raise tests.TestNotApplicable(
+                "test not applicable on non-inventory tests")
         self.assertEqual('', work_tree.get_canonical_inventory_path(''))
         self.assertEqual('/', work_tree.get_canonical_inventory_path('/'))
 
     def test_canonical_path_invalid_all(self):
         work_tree = self._make_canonical_test_tree()
+        if not isinstance(work_tree, InventoryTree):
+            raise tests.TestNotApplicable(
+                "test not applicable on non-inventory tests")
         self.assertEqual('foo/bar',
                          work_tree.get_canonical_inventory_path('foo/bar'))
 
     def test_canonical_invalid_child(self):
         work_tree = self._make_canonical_test_tree()
+        if not isinstance(work_tree, InventoryTree):
+            raise tests.TestNotApplicable(
+                "test not applicable on non-inventory tests")
         self.assertEqual('dir/None',
                          work_tree.get_canonical_inventory_path('Dir/None'))
 
@@ -176,6 +194,9 @@
         work_tree.add(['test/', 'test/file', 'Test'])
 
         test_tree = self._convert_tree(work_tree)
+        if not isinstance(test_tree, InventoryTree):
+            raise tests.TestNotApplicable(
+                "test not applicable on non-inventory tests")
         test_tree.lock_read()
         self.addCleanup(test_tree.unlock)
 




More information about the bazaar-commits mailing list