Rev 3048: Fix up calls to TestCase.build_tree passing a string rather than a list in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Nov 29 08:50:47 GMT 2007


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

------------------------------------------------------------
revno: 3048
revision-id:pqm at pqm.ubuntu.com-20071129084851-xoj1c3u42mxzy5bq
parent: pqm at pqm.ubuntu.com-20071129010913-07e4l7k5x9gfnmoh
parent: mbp at sourcefrog.net-20071129071242-1tcn2a18547udlvw
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2007-11-29 08:48:51 +0000
message:
  Fix up calls to TestCase.build_tree passing a string rather than a list
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/branch_implementations/test_create_checkout.py test_create_checkout-20070322193723-n2wkp1g03r0404di-1
  bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
  bzrlib/tests/workingtree_implementations/test_remove.py test_remove.py-20070413183901-rvnp85rtc0q0sclp-1
    ------------------------------------------------------------
    revno: 3044.1.1
    revision-id:mbp at sourcefrog.net-20071129071242-1tcn2a18547udlvw
    parent: pqm at pqm.ubuntu.com-20071128230840-b2ra2nso0qtqxon6
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: 164476-default-format
    timestamp: Thu 2007-11-29 18:12:42 +1100
    message:
      Fix up calls to TestCase.build_tree passing a string rather than a list
    modified:
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/branch_implementations/test_create_checkout.py test_create_checkout-20070322193723-n2wkp1g03r0404di-1
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
      bzrlib/tests/workingtree_implementations/test_remove.py test_remove.py-20070413183901-rvnp85rtc0q0sclp-1
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2007-11-28 20:59:24 +0000
+++ b/bzrlib/tests/__init__.py	2007-11-29 07:12:42 +0000
@@ -2054,8 +2054,9 @@
             If the transport is readonly or None, "." is opened automatically.
         :return: None
         """
-        assert type(shape) in (list, tuple), ("Parameter 'shape' should be "
-            "a list or a tuple. Got %s instead" % type(shape))
+        if type(shape) not in (list, tuple):
+            raise AssertionError("Parameter 'shape' should be "
+                "a list or a tuple. Got %r instead" % (shape,))
         # It's OK to just create them using forward slashes on windows.
         if transport is None or transport.is_readonly():
             transport = get_transport(".")

=== modified file 'bzrlib/tests/branch_implementations/test_create_checkout.py'
--- a/bzrlib/tests/branch_implementations/test_create_checkout.py	2007-11-08 23:36:39 +0000
+++ b/bzrlib/tests/branch_implementations/test_create_checkout.py	2007-11-29 07:12:42 +0000
@@ -60,5 +60,5 @@
     def test_create_checkout_exists(self):
         """We shouldn't fail if the directory already exists."""
         tree1 = self.make_branch_and_tree('base')
-        self.build_tree('checkout')
+        self.build_tree(['checkout/'])
         tree2 = tree1.branch.create_checkout('checkout', lightweight=True)

=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py	2007-11-26 23:42:15 +0000
+++ b/bzrlib/tests/test_bzrdir.py	2007-11-29 07:12:42 +0000
@@ -894,12 +894,12 @@
         if sys.platform == 'win32' and not win32utils.has_win32file:
             raise TestSkipped('unable to make file hidden without pywin32 library')
         b = bzrdir.BzrDir.create('.')
-        self.build_tree('a')
+        self.build_tree(['a'])
         self.assertEquals(['a'], self.get_ls())
 
     def test_dot_bzr_hidden_with_url(self):
         if sys.platform == 'win32' and not win32utils.has_win32file:
             raise TestSkipped('unable to make file hidden without pywin32 library')
         b = bzrdir.BzrDir.create(urlutils.local_path_to_url('.'))
-        self.build_tree('a')
+        self.build_tree(['a'])
         self.assertEquals(['a'], self.get_ls())

=== modified file 'bzrlib/tests/workingtree_implementations/test_remove.py'
--- a/bzrlib/tests/workingtree_implementations/test_remove.py	2007-11-14 18:48:14 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_remove.py	2007-11-29 07:12:42 +0000
@@ -85,7 +85,7 @@
 
     def test_remove_changed_file(self):
         """Removal of a changed files must fail."""
-        tree = self.get_committed_tree('a')
+        tree = self.get_committed_tree(['a'])
         self.build_tree_contents([('a', "some other new content!")])
         self.assertInWorkingTree('a')
         err = self.assertRaises(errors.BzrRemoveChangedFilesError, tree.remove,




More information about the bazaar-commits mailing list