]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Move initialization to setUp().
authorDaira Hopwood <daira@jacaranda.org>
Mon, 27 Apr 2015 22:20:22 +0000 (23:20 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Mon, 27 Apr 2015 22:20:22 +0000 (23:20 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/test/test_drop_upload.py

index c89751d669aded41f166947db5929f8c8ace19ac..a4ee7e7160a231c67bbaedc9af330d0630575bb5 100644 (file)
@@ -25,6 +25,11 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA
     with the real INotify.
     """
 
+    def setUp(self):
+        GridTestMixin.setUp(self)
+        self.uploader = None
+        self.dir_node = None
+
     def _get_count(self, name):
         return self.stats_provider.get_stats()["counters"].get(name, 0)
 
@@ -99,7 +104,6 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA
         self.failIfEqual(was_uploaded, False)
 
     def _test_uploader_start_service(self):
-        self.uploader = None
         self.set_up_grid()
         self.client = self.g.clients[0]
         self.stats_provider = self.client.stats_provider
@@ -114,8 +118,6 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA
 
     def _test_move_tree(self):
         print "_test_move_tree"
-        self.uploader = None
-        self.dir_node = None
         self.set_up_grid()
 
         self.local_dir = os.path.join(self.basedir, u"l\u00F8cal_dir")
@@ -172,8 +174,6 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA
         a second time. This test is meant to test the database persistence along with
         the startup and shutdown code paths of the uploader.
         """
-        self.uploader = None
-        self.dir_node = None
         self.set_up_grid()
         self.local_dir = os.path.join(self.basedir, u"test_persistence")
         self.mkdir_nonascii(self.local_dir)
@@ -211,8 +211,6 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA
         return d
 
     def _test(self):
-        self.uploader = None
-        self.dir_node = None
         self.set_up_grid()
         self.local_dir = os.path.join(self.basedir, self.unicode_or_fallback(u"loc\u0101l_dir", u"local_dir"))
         self.mkdir_nonascii(self.local_dir)