Rev 4399: Use assertLength as it provides a better ouput to debug tests. in file:///home/vila/src/bzr/reviews/smooth-upgrades/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Dec 7 10:16:53 GMT 2010


At file:///home/vila/src/bzr/reviews/smooth-upgrades/

------------------------------------------------------------
revno: 4399
revision-id: v.ladeuil+lp at free.fr-20101207101653-20iiufih26buvmy3
parent: v.ladeuil+lp at free.fr-20101207100347-arrmlj9q73noqp7j
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: smooth-upgrades
timestamp: Tue 2010-12-07 11:16:53 +0100
message:
  Use assertLength as it provides a better ouput to debug tests.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_upgrade.py'
--- a/bzrlib/tests/test_upgrade.py	2010-12-04 18:26:55 +0000
+++ b/bzrlib/tests/test_upgrade.py	2010-12-07 10:16:53 +0000
@@ -439,11 +439,11 @@
     def test_upgrade_standalone_branch(self):
         control = self.make_standalone_branch()
         tried, worked, issues = smart_upgrade([control], format=self.to_format)
-        self.assertEqual(1, len(tried))
+        self.assertLength(1, tried)
         self.assertEqual(tried[0], control)
-        self.assertEqual(1, len(worked))
+        self.assertLength(1, worked)
         self.assertEqual(worked[0], control)
-        self.assertEqual(0, len(issues))
+        self.assertLength(0, issues)
         self.failUnlessExists('branch1/backup.bzr.~1~')
         self.assertEqual(control.open_repository()._format,
                          self.to_format._repository_format)
@@ -452,11 +452,11 @@
         control = self.make_standalone_branch()
         tried, worked, issues = smart_upgrade([control], format=self.to_format,
             clean_up=True)
-        self.assertEqual(1, len(tried))
+        self.assertLength(1, tried)
         self.assertEqual(tried[0], control)
-        self.assertEqual(1, len(worked))
+        self.assertLength(1, worked)
         self.assertEqual(worked[0], control)
-        self.assertEqual(0, len(issues))
+        self.assertLength(0, issues)
         self.failUnlessExists('branch1')
         self.failUnlessExists('branch1/.bzr')
         self.failIfExists('branch1/backup.bzr.~1~')
@@ -477,11 +477,11 @@
     def test_upgrade_repo_with_branches(self):
         control = self.make_repo_with_branches()
         tried, worked, issues = smart_upgrade([control], format=self.to_format)
-        self.assertEqual(3, len(tried))
+        self.assertLength(3, tried)
         self.assertEqual(tried[0], control)
-        self.assertEqual(3, len(worked))
+        self.assertLength(3, worked)
         self.assertEqual(worked[0], control)
-        self.assertEqual(0, len(issues))
+        self.assertLength(0, issues)
         self.failUnlessExists('repo/backup.bzr.~1~')
         self.failUnlessExists('repo/branch1/backup.bzr.~1~')
         self.failUnlessExists('repo/branch2/backup.bzr.~1~')
@@ -494,11 +494,11 @@
         control = self.make_repo_with_branches()
         tried, worked, issues = smart_upgrade([control], format=self.to_format,
             clean_up=True)
-        self.assertEqual(3, len(tried))
+        self.assertLength(3, tried)
         self.assertEqual(tried[0], control)
-        self.assertEqual(3, len(worked))
+        self.assertLength(3, worked)
         self.assertEqual(worked[0], control)
-        self.assertEqual(0, len(issues))
+        self.assertLength(0, issues)
         self.failUnlessExists('repo')
         self.failUnlessExists('repo/.bzr')
         self.failIfExists('repo/backup.bzr.~1~')



More information about the bazaar-commits mailing list