From: Daira Hopwood Date: Tue, 28 Apr 2015 16:13:07 +0000 (+0100) Subject: Simplifications. X-Git-Url: https://git.rkrishnan.org/reedownlee?a=commitdiff_plain;h=d91c5fe78e40a88d944edd61621032b6da9c24f2;p=tahoe-lafs%2Ftahoe-lafs.git Simplifications. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/test/test_drop_upload.py b/src/allmydata/test/test_drop_upload.py index a8ee7b97..ade1281e 100644 --- a/src/allmydata/test/test_drop_upload.py +++ b/src/allmydata/test/test_drop_upload.py @@ -34,7 +34,8 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA def _get_count(self, name): return self.stats_provider.get_stats()["counters"].get(name, 0) - def _createdb(self, dbfile): + def _createdb(self): + dbfile = abspath_expanduser_unicode(u"magicfolderdb.sqlite", base=self.basedir) bdb = backupdb.get_backupdb(dbfile) self.failUnless(bdb, "unable to create backupdb from %r" % (dbfile,)) self.failUnlessEqual(bdb.VERSION, 2) @@ -67,15 +68,13 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA def test_db_basic(self): fileutil.make_dirs(self.basedir) - dbfile = abspath_expanduser_unicode(u"dbfile", base=self.basedir) - self._createdb(dbfile) + self._createdb() def test_db_persistence(self): """Test that a file upload creates an entry in the database.""" fileutil.make_dirs(self.basedir) - dbfile = abspath_expanduser_unicode(u"dbfile", base=self.basedir) - db = self._createdb(dbfile) + db = self._createdb() path = abspath_expanduser_unicode(u"myFile1", base=self.basedir) db.did_upload_file('URI:LIT:1', path, 0, 0, 33) @@ -98,8 +97,7 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA mtime = s[stat.ST_MTIME] db.did_upload_file('URI:LIT:2', path, mtime, ctime, size) r = db.check_file(path) - was_uploaded = r.was_uploaded() - self.failIfEqual(was_uploaded, False) + self.failUnless(r.was_uploaded()) def test_uploader_start_service(self): self.set_up_grid()