Skip to content

Commit

Permalink
Merge pull request tahoe-lafs#996 from tahoe-lafs/3628.port-more-test…
Browse files Browse the repository at this point in the history
…s-python-3

Port more tests to Python 3

Fixes ticket:3628
  • Loading branch information
itamarst committed Mar 12, 2021
2 parents a4a8a22 + 719c729 commit 9bb30d2
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 62 deletions.
File renamed without changes.
2 changes: 2 additions & 0 deletions src/allmydata/test/cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def do_cli(self, verb, *args, **kwargs):
# Python functions want native strings. So ignore the requirements
# for passing arguments to another process and make sure this argument
# is a native string.
verb = ensure_str(verb)
args = [ensure_str(arg) for arg in args]
client_dir = ensure_str(self.get_clientdir(i=client_num))
nodeargs = [ b"--node-directory", client_dir ]
return run_cli(verb, *args, nodeargs=nodeargs, **kwargs)
2 changes: 1 addition & 1 deletion src/allmydata/test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ def _corrupt_mutable_share_data(data, debug=False):
assert prefix == MutableShareFile.MAGIC, "This function is designed to corrupt mutable shares of v1, and the magic number doesn't look right: %r vs %r" % (prefix, MutableShareFile.MAGIC)
data_offset = MutableShareFile.DATA_OFFSET
sharetype = data[data_offset:data_offset+1]
assert sharetype == "\x00", "non-SDMF mutable shares not supported"
assert sharetype == b"\x00", "non-SDMF mutable shares not supported"
(version, ig_seqnum, ig_roothash, ig_IV, ig_k, ig_N, ig_segsize,
ig_datalen, offsets) = unpack_header(data[data_offset:])
assert version == 0, "this function only handles v0 SDMF files"
Expand Down

0 comments on commit 9bb30d2

Please sign in to comment.