Created
September 12, 2017 17:09
-
-
Save exarkun/e37972e305cb83e10d6ba633e7d82315 to your computer and use it in GitHub Desktop.
test_publish_after_config_change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/allmydata/test/mutable/test_update.py b/src/allmydata/test/mutable/test_update.py | |
index 5001853..6ffa9c9 100644 | |
--- a/src/allmydata/test/mutable/test_update.py | |
+++ b/src/allmydata/test/mutable/test_update.py | |
@@ -129,6 +129,30 @@ class Update(GridTestMixin, unittest.TestCase, testutil.ShouldFailMixin): | |
self.fail("didn't get expected data") | |
+ def test_publish_after_config_change(self): | |
+ d0 = self.do_upload_mdmf() | |
+ def _reconfig(ign): | |
+ client = self.get_client(0) | |
+ client.encoding_params["k"] += 1 | |
+ client.encoding_params["n"] += 1 | |
+ return self.restart_client(0) | |
+ d0.addCallback(_reconfig) | |
+ | |
+ def _run(ign): | |
+ expected = self.data[::-1] | |
+ | |
+ d = defer.succeed(None) | |
+ d.addCallback(lambda ign: self.mdmf_node.get_best_mutable_version()) | |
+ d.addCallback(lambda mv: mv.update(MutableData(expected), 0)) | |
+ d.addCallback(lambda ign: self.mdmf_node.download_best_version()) | |
+ def _check(results): | |
+ self.assertEqual(results, expected) | |
+ d.addCallback(_check) | |
+ return d | |
+ d0.addCallback(_run) | |
+ return d0 | |
+ | |
+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment