From 19cf58f2aa2ad5a0233d11ef8198dc1221fd788c Mon Sep 17 00:00:00 2001 From: kevan Date: Sat, 17 Sep 2011 17:35:33 -0700 Subject: [PATCH] test/test_mutable: refactor publish surprise test into common test fixture, rewrite test_publish_surprise to use test fixture --- src/allmydata/test/test_mutable.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/allmydata/test/test_mutable.py b/src/allmydata/test/test_mutable.py index 2b119ee1..5a1534d6 100644 --- a/src/allmydata/test/test_mutable.py +++ b/src/allmydata/test/test_mutable.py @@ -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() -- 2.45.2