]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test/test_mutable: refactor publish surprise test into common test fixture, rewrite...
authorkevan <kevan@isnotajoke.com>
Sun, 18 Sep 2011 00:35:33 +0000 (17:35 -0700)
committerkevan <kevan@isnotajoke.com>
Sun, 18 Sep 2011 00:35:33 +0000 (17:35 -0700)
src/allmydata/test/test_mutable.py

index 2b119ee1689fe64534918b3272d54c513ba8bb52..5a1534d64a45bb05bdd0efdceef7ae51a971ee42 100644 (file)
@@ -2500,11 +2500,12 @@ class FirstServerGetsDeleted:
         return retval
 
 class Problems(GridTestMixin, unittest.TestCase, testutil.ShouldFailMixin):
-    def test_publish_surprise(self):
-        self.basedir = "mutable/Problems/test_publish_surprise"
+    def do_publish_surprise(self, version):
+        self.basedir = "mutable/Problems/test_publish_surprise_%s" % version
         self.set_up_grid()
         nm = self.g.clients[0].nodemaker
-        d = nm.create_mutable_file(MutableData("contents 1"))
+        d = nm.create_mutable_file(MutableData("contents 1"),
+                                    version=version)
         def _created(n):
             d = defer.succeed(None)
             d.addCallback(lambda res: n.get_servermap(MODE_WRITE))
@@ -2528,6 +2529,9 @@ class Problems(GridTestMixin, unittest.TestCase, testutil.ShouldFailMixin):
         d.addCallback(_created)
         return d
 
+    def test_publish_surprise(self):
+        return self.do_publish_surprise(SDMF_VERSION)
+
     def test_retrieve_surprise(self):
         self.basedir = "mutable/Problems/test_retrieve_surprise"
         self.set_up_grid()