]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test_cli.backup: oops, fix test to work even when sqlite is unavailable
authorBrian Warner <warner@allmydata.com>
Fri, 6 Feb 2009 05:10:42 +0000 (22:10 -0700)
committerBrian Warner <warner@allmydata.com>
Fri, 6 Feb 2009 05:10:42 +0000 (22:10 -0700)
src/allmydata/test/test_cli.py

index ebfd5ed27651d2e88725817f076a9024437402a0..b2b5dc8f3f5766a04d7d3142fe978a8f28f70add 100644 (file)
@@ -754,7 +754,10 @@ class Backup(SystemTestMixin, CLITestMixin, unittest.TestCase):
             self.failUnlessEqual(err, "")
             self.failUnlessEqual(rc, 0)
             self.new_archives = out.split()
-            self.failUnlessEqual(len(self.new_archives), 3)
+            expected_new = 2
+            if have_bdb:
+                expected_new += 1
+            self.failUnlessEqual(len(self.new_archives), expected_new)
             # the original backup should still be the oldest (i.e. sorts
             # alphabetically towards the beginning)
             self.failUnlessEqual(sorted(self.new_archives)[0],
@@ -794,7 +797,10 @@ class Backup(SystemTestMixin, CLITestMixin, unittest.TestCase):
             self.failUnlessEqual(err, "")
             self.failUnlessEqual(rc, 0)
             self.new_archives = out.split()
-            self.failUnlessEqual(len(self.new_archives), 4)
+            expected_new = 3
+            if have_bdb:
+                expected_new += 1
+            self.failUnlessEqual(len(self.new_archives), expected_new)
             self.failUnlessEqual(sorted(self.new_archives)[0],
                                  self.old_archives[0])
         d.addCallback(_check6)