Changeset 0f6d665 in trunk


Ignore:
Timestamp:
2019-08-24T20:26:09Z (6 years ago)
Author:
meejah <meejah@…>
Branches:
master
Children:
b6f0832
Parents:
20f907f
git-author:
meejah <meejah@…> (2019-08-24 18:53:36)
git-committer:
meejah <meejah@…> (2019-08-24 20:26:09)
Message:

fewer magic numbers (and a fix to upload encoding)

Location:
integration
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified integration/test_web.py

    r20f907f r0f6d665  
    7878    """
    7979
    80     FILE_CONTENTS = u"added via PUT"
     80    FILE_CONTENTS = b"added via PUT" * 20
    8181
    8282    resp = requests.put(
    8383        util.node_url(alice.node_dir, u"uri"),
    84         files={
    85             u"file": FILE_CONTENTS,
    86         },
     84        data=FILE_CONTENTS,
    8785    )
    8886    cap = allmydata.uri.from_string(resp.text.strip().encode('ascii'))
     87    cfg = alice.get_config()
    8988    assert isinstance(cap, allmydata.uri.CHKFileURI)
    90     assert cap.size == 153
    91     assert cap.total_shares == 4
    92     assert cap.needed_shares == 2
     89    assert cap.size == len(FILE_CONTENTS)
     90    assert cap.total_shares == int(cfg.get_config("client", "shares.total"))
     91    assert cap.needed_shares == int(cfg.get_config("client", "shares.needed"))
    9392
    9493
  • TabularUnified integration/util.py

    r20f907f r0f6d665  
    1818    write_config,
    1919)
     20from allmydata import client
    2021
    2122import pytest_twisted
     
    164165    def node_dir(self):
    165166        return self._node_dir
     167
     168    def get_config(self):
     169        return client.read_config(
     170            self._node_dir,
     171            u"portnum",
     172        )
    166173
    167174    def __str__(self):
Note: See TracChangeset for help on using the changeset viewer.