Ported to Python 3.

This commit is contained in:
Itamar Turner-Trauring 2020-11-06 11:25:48 -05:00
parent bcc6d91444
commit dfdaac7474
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,15 @@
"""
Ported to Python 3.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future.utils import PY2
if PY2:
from future.builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, bytes, dict, list, object, range, str, max, min # noqa: F401
import os, base64 import os, base64
from twisted.trial import unittest from twisted.trial import unittest
from allmydata import uri from allmydata import uri
@ -22,10 +34,10 @@ class Interoperability(GridTestMixin, unittest.TestCase, testutil.ShouldFailMixi
sdmf_old_contents = b"This is a test file.\n" sdmf_old_contents = b"This is a test file.\n"
def copy_sdmf_shares(self): def copy_sdmf_shares(self):
# We'll basically be short-circuiting the upload process. # We'll basically be short-circuiting the upload process.
servernums = self.g.servers_by_number.keys() servernums = list(self.g.servers_by_number.keys())
assert len(servernums) == 10 assert len(servernums) == 10
assignments = zip(self.sdmf_old_shares.keys(), servernums) assignments = list(zip(self.sdmf_old_shares.keys(), servernums))
# Get the storage index. # Get the storage index.
cap = uri.from_string(self.sdmf_old_cap) cap = uri.from_string(self.sdmf_old_cap)
si = cap.get_storage_index() si = cap.get_storage_index()

View File

@ -101,6 +101,7 @@ PORTED_TEST_MODULES = [
"allmydata.test.mutable.test_exceptions", "allmydata.test.mutable.test_exceptions",
"allmydata.test.mutable.test_filehandle", "allmydata.test.mutable.test_filehandle",
"allmydata.test.mutable.test_filenode", "allmydata.test.mutable.test_filenode",
"allmydata.test.mutable.test_interoperability",
"allmydata.test.test_abbreviate", "allmydata.test.test_abbreviate",
"allmydata.test.test_base32", "allmydata.test.test_base32",
"allmydata.test.test_base62", "allmydata.test.test_base62",