From 814fec5495bd8c894f8e1050187357f3ba3907e9 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 5 Feb 2009 22:10:42 -0700 Subject: [PATCH] test_cli.backup: oops, fix test to work even when sqlite is unavailable --- src/allmydata/test/test_cli.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/allmydata/test/test_cli.py b/src/allmydata/test/test_cli.py index ebfd5ed2..b2b5dc8f 100644 --- a/src/allmydata/test/test_cli.py +++ b/src/allmydata/test/test_cli.py @@ -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) -- 2.45.2