diff --git a/integration/test_web.py b/integration/test_web.py index f316c124c..79d90352a 100644 --- a/integration/test_web.py +++ b/integration/test_web.py @@ -77,19 +77,18 @@ def test_put(alice): use PUT to create a file """ - FILE_CONTENTS = u"added via PUT" + FILE_CONTENTS = b"added via PUT" * 20 resp = requests.put( util.node_url(alice.node_dir, u"uri"), - files={ - u"file": FILE_CONTENTS, - }, + data=FILE_CONTENTS, ) cap = allmydata.uri.from_string(resp.text.strip().encode('ascii')) + cfg = alice.get_config() assert isinstance(cap, allmydata.uri.CHKFileURI) - assert cap.size == 153 - assert cap.total_shares == 4 - assert cap.needed_shares == 2 + assert cap.size == len(FILE_CONTENTS) + assert cap.total_shares == int(cfg.get_config("client", "shares.total")) + assert cap.needed_shares == int(cfg.get_config("client", "shares.needed")) def test_helper_status(storage_nodes): diff --git a/integration/util.py b/integration/util.py index f5d2e1f07..aef9ba544 100644 --- a/integration/util.py +++ b/integration/util.py @@ -17,6 +17,7 @@ from allmydata.util.configutil import ( set_config, write_config, ) +from allmydata import client import pytest_twisted @@ -164,6 +165,12 @@ class TahoeProcess(object): def node_dir(self): return self._node_dir + def get_config(self): + return client.read_config( + self._node_dir, + u"portnum", + ) + def __str__(self): return "".format(self._node_dir)