From 50df45e3a0e7125f4431a1f12acf74a20df5f4ae Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 3 Aug 2016 18:38:51 -0400 Subject: [PATCH] add GridTestMixin.set_up_grid(oneshare=True) This configures client[0] to use k=N=1, which is a lot faster for tests that don't care about the actual shares (e.g. most of the CLI tests). --- src/allmydata/test/no_network.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/allmydata/test/no_network.py b/src/allmydata/test/no_network.py index c18aa676a..802345c3b 100644 --- a/src/allmydata/test/no_network.py +++ b/src/allmydata/test/no_network.py @@ -360,13 +360,18 @@ class GridTestMixin: return self.s.stopService() def set_up_grid(self, num_clients=1, num_servers=10, - client_config_hooks={}): + client_config_hooks={}, oneshare=False): # self.basedir must be set self.g = NoNetworkGrid(self.basedir, num_clients=num_clients, num_servers=num_servers, client_config_hooks=client_config_hooks) self.g.setServiceParent(self.s) + if oneshare: + c = self.get_client(0) + c.encoding_params["k"] = 1 + c.encoding_params["happy"] = 1 + c.encoding_params["n"] = 1 self._record_webports_and_baseurls() def _record_webports_and_baseurls(self):