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).
This commit is contained in:
Brian Warner 2016-08-03 18:38:51 -04:00
parent e431faf58c
commit 50df45e3a0

View File

@ -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):