Changeset 17f0676 in trunk


Ignore:
Timestamp:
2020-10-09T14:22:17Z (5 years ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
3ea18ca
Parents:
c680b1d (diff), cc8c9c0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Itamar Turner-Trauring <itamar@…> (2020-10-09 14:22:17)
git-committer:
GitHub <noreply@…> (2020-10-09 14:22:17)
Message:

Merge branch 'master' into 3459.test-checker-python-3

Files:
7 added
1 deleted
35 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified Makefile

    rc680b1d r17f0676  
    5252test-venv-coverage:
    5353# Special handling for reporting coverage even when the test run fails
     54        rm -f ./.coverage.*
    5455        test_exit=
    5556        $(VIRTUAL_ENV)/bin/coverage run -m twisted.trial --rterrors --reporter=timing \
  • TabularUnified misc/python3/Makefile

    rc680b1d r17f0676  
    1 # BBB: Python 3 porting targets
     1# Python 3 porting targets
    22#
    33# NOTE: this Makefile requires GNU make
  • TabularUnified src/allmydata/__init__.py

    rc680b1d r17f0676  
    4343from future import standard_library
    4444standard_library.install_aliases()
     45
     46
     47# Monkey-patch 3rd party libraries:
     48from ._monkeypatch import patch
     49patch()
     50del patch
  • TabularUnified src/allmydata/client.py

    rc680b1d r17f0676  
    7070    """
    7171    return (
    72         section_name.startswith(b"storageserver.plugins.") or
    73         section_name.startswith(b"storageclient.plugins.")
     72        section_name.startswith("storageserver.plugins.") or
     73        section_name.startswith("storageclient.plugins.")
    7474    )
    7575
  • TabularUnified src/allmydata/immutable/downloader/share.py

    rc680b1d r17f0676  
    77from __future__ import unicode_literals
    88
    9 from future.utils import PY2, native_str
     9from future.utils import PY2
    1010if PY2:
    1111    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
     
    766766
    767767    def _send_request(self, start, length):
    768         # For some reason tests fail on Python 2 if this is not a native
    769         # string...
    770         return self._rref.callRemote(native_str("read"), start, length)
     768        return self._rref.callRemote("read", start, length)
    771769
    772770    def _got_data(self, data, start, length, block_ev, lp):
  • TabularUnified src/allmydata/immutable/encode.py

    rc680b1d r17f0676  
    11# -*- test-case-name: allmydata.test.test_encode -*-
     2
     3"""
     4Ported to Python 3.
     5"""
     6
     7from __future__ import division
     8from __future__ import absolute_import
     9from __future__ import print_function
     10from __future__ import unicode_literals
     11
     12from future.utils import PY2
     13if PY2:
     14    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
    215
    316import time
     
    469482                      self.segment_size*(segnum+1),
    470483                      self.segment_size*self.num_segments,
    471                       100 * (segnum+1) / self.num_segments,
     484                      100 * (segnum+1) // self.num_segments,
    472485                      ),
    473486                     level=log.OPERATIONAL)
  • TabularUnified src/allmydata/immutable/filenode.py

    rc680b1d r17f0676  
     1"""
     2Ported to Python 3.
     3"""
     4
     5from __future__ import absolute_import
     6from __future__ import division
     7from __future__ import print_function
     8from __future__ import unicode_literals
     9
     10from future.utils import PY2
     11if PY2:
     12    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
     13
    114from functools import reduce
    215import binascii
  • TabularUnified src/allmydata/immutable/layout.py

    rc680b1d r17f0676  
     1"""
     2Ported to Python 3.
     3"""
     4from __future__ import absolute_import
     5from __future__ import division
     6from __future__ import print_function
     7from __future__ import unicode_literals
     8
     9from future.utils import PY2
     10if PY2:
     11    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
     12
    113import struct
    214from zope.interface import implementer
  • TabularUnified src/allmydata/immutable/upload.py

    rc680b1d r17f0676  
     1"""
     2Ported to Python 3.
     3"""
     4
     5from __future__ import absolute_import
     6from __future__ import division
     7from __future__ import print_function
     8from __future__ import unicode_literals
     9
     10from future.utils import PY2, native_str
     11if PY2:
     12    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
    113from past.builtins import long, unicode
    214
     
    6779        server: list(shares)
    6880        for (server, shares)
    69         in existing_shares.iteritems()
     81        in existing_shares.items()
    7082    }
    7183
     
    8092        sharenum: base32.b2a(serverid)
    8193        for (sharenum, serverid)
    82         in happiness_mappings.iteritems()
     94        in happiness_mappings.items()
    8395    }
    8496
     
    151163    # helper, and it does *not* need to match the fully-qualified
    152164    # package/module/class name
    153     typeToCopy = "allmydata.upload.UploadResults.tahoe.allmydata.com"
     165    #
     166    # Needs to be native string to make Foolscap happy.
     167    typeToCopy = native_str("allmydata.upload.UploadResults.tahoe.allmydata.com")
    154168    copytype = typeToCopy
    155169
     
    284298        (alreadygot, buckets) = alreadygot_and_buckets
    285299        b = {}
    286         for sharenum, rref in buckets.items():
     300        for sharenum, rref in list(buckets.items()):
    287301            bp = self.wbp_class(rref, self._server, self.sharesize,
    288302                                self.blocksize,
     
    781795        shares_to_ask = set()
    782796        servermap = self._share_placements
    783         for shnum, tracker_id in servermap.items():
     797        for shnum, tracker_id in list(servermap.items()):
    784798            if tracker_id == None:
    785799                continue
     
    15751589
    15761590        sharemap = upload_results.sharemap
    1577         if str in [type(v) for v in sharemap.values()]:
     1591        if any(isinstance(v, (bytes, unicode)) for v in sharemap.values()):
    15781592            upload_results.sharemap = None
    15791593
  • TabularUnified src/allmydata/node.py

    rc680b1d r17f0676  
    1010import types
    1111import errno
     12from io import StringIO
     13import tempfile
     14from base64 import b32decode, b32encode
     15
     16# Python 2 compatibility
    1217from six.moves import configparser
    13 import tempfile
    14 from io import BytesIO
    15 from base64 import b32decode, b32encode
     18from future.utils import PY2
     19if PY2:
     20    from io import BytesIO as StringIO  # noqa: F811
    1621
    1722from twisted.python import log as twlog
     
    7176# reports.
    7277for thing, things_version in get_package_versions().items():
    73     app_versions.add_version(thing, str(things_version))
     78    app_versions.add_version(thing, things_version)
    7479
    7580# group 1 will be addr (dotted quad string), group 3 if any will be portnum (string)
     
    207212    # load configuration from in-memory string
    208213    parser = configparser.SafeConfigParser()
    209     parser.readfp(BytesIO(config_str))
     214    parser.readfp(StringIO(config_str))
    210215
    211216    fname = "<in-memory>"
     
    822827            # o might be a FileLogObserver's .emit method
    823828            if type(o) is type(self.setup_logging): # bound method
    824                 ob = o.im_self
     829                ob = o.__self__
    825830                if isinstance(ob, twlog.FileLogObserver):
    826                     newmeth = types.UnboundMethodType(formatTimeTahoeStyle, ob, ob.__class__)
     831                    newmeth = types.MethodType(formatTimeTahoeStyle, ob)
    827832                    ob.formatTime = newmeth
    828833        # TODO: twisted >2.5.0 offers maxRotatedFiles=50
  • TabularUnified src/allmydata/scripts/common.py

    rc680b1d r17f0676  
    55from os.path import join
    66
    7 # BBB: Python 2 compatibility
     7# Python 2 compatibility
    88from future.utils import PY2
    99if PY2:
  • TabularUnified src/allmydata/scripts/stats_gatherer.py

    rc680b1d r17f0676  
    33import os
    44
    5 # BBB: Python 2 compatibility
     5# Python 2 compatibility
    66from future.utils import PY2
    77if PY2:
  • TabularUnified src/allmydata/scripts/tahoe_check.py

    rc680b1d r17f0676  
    44import json
    55
    6 # BBB: Python 2 compatibility
     6# Python 2 compatibility
    77from future.utils import PY2
    88if PY2:
  • TabularUnified src/allmydata/stats.py

    rc680b1d r17f0676  
    77from collections import deque
    88
    9 # BBB: Python 2 compatibility
     9# Python 2 compatibility
    1010from future.utils import PY2
    1111if PY2:
  • TabularUnified src/allmydata/test/check_load.py

    rc680b1d r17f0676  
    3838import urllib, json, random, time, urlparse
    3939
    40 # BBB: Python 2 compatibility
     40# Python 2 compatibility
    4141from future.utils import PY2
    4242if PY2:
  • TabularUnified src/allmydata/test/check_memory.py

    rc680b1d r17f0676  
    33import os, shutil, sys, urllib, time, stat, urlparse
    44
    5 # BBB: Python 2 compatibility
     5# Python 2 compatibility
    66from future.utils import PY2
    77if PY2:
  • TabularUnified src/allmydata/test/common.py

    rc680b1d r17f0676  
    4747)
    4848
     49from twisted.application import service
    4950from twisted.plugin import IPlugin
    5051from twisted.internet import defer
     
    8889    EliotLoggedRunTest,
    8990)
    90 # Backwards compatibility imports:
    91 from .common_py3 import LoggingServiceParent, ShouldFailMixin  # noqa: F401
     91from .common_util import ShouldFailMixin  # noqa: F401
    9292
    9393
     
    9595
    9696EMPTY_CLIENT_CONFIG = config_from_string(
    97     b"/dev/null",
    98     b"tub.port",
    99     b""
     97    "/dev/null",
     98    "tub.port",
     99    ""
    100100)
    101101
     
    250250        self.config = config_from_string(
    251251            self.basedir.asTextMode().path,
    252             u"tub.port",
    253 b"""
     252            "tub.port",
     253"""
    254254[node]
    255255{node_config}
     
    782782
    783783
     784class LoggingServiceParent(service.MultiService):
     785    def log(self, *args, **kwargs):
     786        return log.msg(*args, **kwargs)
     787
     788
    784789TEST_DATA=b"\x02"*(Uploader.URI_LIT_SIZE_THRESHOLD+1)
    785790
  • TabularUnified src/allmydata/test/common_util.py

    rc680b1d r17f0676  
    22
    33import os
     4import time
     5import signal
    46from random import randrange
    57from six.moves import StringIO
    68
    79from twisted.internet import reactor, defer
     10from twisted.python import failure
    811from twisted.trial import unittest
    912
    1013from ..util.assertutil import precondition
    1114from ..scripts import runner
    12 from allmydata.util.encodingutil import get_io_encoding
     15from allmydata.util.encodingutil import unicode_platform, get_filesystem_encoding, get_io_encoding
    1316# Imported for backwards compatibility:
    1417from future.utils import bord, bchr, binary_type
    15 from .common_py3 import (
    16     SignalMixin, skip_if_cannot_represent_filename, ReallyEqualMixin, ShouldFailMixin
    17 )
    18 
     18from past.builtins import unicode
     19
     20
     21def skip_if_cannot_represent_filename(u):
     22    precondition(isinstance(u, unicode))
     23
     24    enc = get_filesystem_encoding()
     25    if not unicode_platform():
     26        try:
     27            u.encode(enc)
     28        except UnicodeEncodeError:
     29            raise unittest.SkipTest("A non-ASCII filename could not be encoded on this platform.")
    1930
    2031def skip_if_cannot_represent_argv(u):
     
    7990
    8091
     92class ReallyEqualMixin(object):
     93    def failUnlessReallyEqual(self, a, b, msg=None):
     94        self.assertEqual(a, b, msg)
     95        self.assertEqual(type(a), type(b), "a :: %r (%s), b :: %r (%s), %r" % (a, type(a), b, type(b), msg))
     96
     97
     98class SignalMixin(object):
     99    # This class is necessary for any code which wants to use Processes
     100    # outside the usual reactor.run() environment. It is copied from
     101    # Twisted's twisted.test.test_process . Note that Twisted-8.2.0 uses
     102    # something rather different.
     103    sigchldHandler = None
     104
     105    def setUp(self):
     106        # make sure SIGCHLD handler is installed, as it should be on
     107        # reactor.run(). problem is reactor may not have been run when this
     108        # test runs.
     109        if hasattr(reactor, "_handleSigchld") and hasattr(signal, "SIGCHLD"):
     110            self.sigchldHandler = signal.signal(signal.SIGCHLD,
     111                                                reactor._handleSigchld)
     112        return super(SignalMixin, self).setUp()
     113
     114    def tearDown(self):
     115        if self.sigchldHandler:
     116            signal.signal(signal.SIGCHLD, self.sigchldHandler)
     117        return super(SignalMixin, self).tearDown()
     118
     119
    81120class StallMixin(object):
    82121    def stall(self, res=None, delay=1):
    83122        d = defer.Deferred()
    84123        reactor.callLater(delay, d.callback, res)
     124        return d
     125
     126
     127class Marker(object):
     128    pass
     129
     130class FakeCanary(object):
     131    """For use in storage tests.
     132    """
     133    def __init__(self, ignore_disconnectors=False):
     134        self.ignore = ignore_disconnectors
     135        self.disconnectors = {}
     136    def notifyOnDisconnect(self, f, *args, **kwargs):
     137        if self.ignore:
     138            return
     139        m = Marker()
     140        self.disconnectors[m] = (f, args, kwargs)
     141        return m
     142    def dontNotifyOnDisconnect(self, marker):
     143        if self.ignore:
     144            return
     145        del self.disconnectors[marker]
     146    def getRemoteTubID(self):
     147        return None
     148    def getPeer(self):
     149        return "<fake>"
     150
     151
     152class ShouldFailMixin(object):
     153
     154    def shouldFail(self, expected_failure, which, substring,
     155                   callable, *args, **kwargs):
     156        """Assert that a function call raises some exception. This is a
     157        Deferred-friendly version of TestCase.assertRaises() .
     158
     159        Suppose you want to verify the following function:
     160
     161         def broken(a, b, c):
     162             if a < 0:
     163                 raise TypeError('a must not be negative')
     164             return defer.succeed(b+c)
     165
     166        You can use:
     167            d = self.shouldFail(TypeError, 'test name',
     168                                'a must not be negative',
     169                                broken, -4, 5, c=12)
     170        in your test method. The 'test name' string will be included in the
     171        error message, if any, because Deferred chains frequently make it
     172        difficult to tell which assertion was tripped.
     173
     174        The substring= argument, if not None, must appear in the 'repr'
     175        of the message wrapped by this Failure, or the test will fail.
     176        """
     177
     178        assert substring is None or isinstance(substring, (bytes, unicode))
     179        d = defer.maybeDeferred(callable, *args, **kwargs)
     180        def done(res):
     181            if isinstance(res, failure.Failure):
     182                res.trap(expected_failure)
     183                if substring:
     184                    self.failUnless(substring in str(res),
     185                                    "%s: substring '%s' not in '%s'"
     186                                    % (which, substring, str(res)))
     187                # return the Failure for further analysis, but in a form that
     188                # doesn't make the Deferred chain think that we failed.
     189                return [res]
     190            else:
     191                self.fail("%s was supposed to raise %s, not get '%s'" %
     192                          (which, expected_failure, res))
     193        d.addBoth(done)
    85194        return d
    86195
     
    131240        if required_to_quiesce and active:
    132241            self.fail("Reactor was still active when it was required to be quiescent.")
     242
     243
     244class TimezoneMixin(object):
     245
     246    def setTimezone(self, timezone):
     247        def tzset_if_possible():
     248            # Windows doesn't have time.tzset().
     249            if hasattr(time, 'tzset'):
     250                time.tzset()
     251
     252        unset = object()
     253        originalTimezone = os.environ.get('TZ', unset)
     254        def restoreTimezone():
     255            if originalTimezone is unset:
     256                del os.environ['TZ']
     257            else:
     258                os.environ['TZ'] = originalTimezone
     259            tzset_if_possible()
     260
     261        os.environ['TZ'] = timezone
     262        self.addCleanup(restoreTimezone)
     263        tzset_if_possible()
     264
     265    def have_working_tzset(self):
     266        return hasattr(time, 'tzset')
    133267
    134268
  • TabularUnified src/allmydata/test/eliotutil.py

    rc680b1d r17f0676  
    33"""
    44
    5 # BBB: Python 2 compatibility
     5# Python 2 compatibility
    66# Can't use `builtins.str` because it's not JSON encodable:
    77# `exceptions.TypeError: <class 'future.types.newstr.newstr'> is not JSON-encodeable`
     
    107107        # Begin an action that should comprise all messages from the decorated
    108108        # test method.
    109         with RUN_TEST(name=self.id().decode("utf-8")).context() as action:
     109        with RUN_TEST(name=self.id()).context() as action:
    110110            # When the test method Deferred fires, the RUN_TEST action is
    111111            # done.  However, we won't have re-published the MemoryLogger
  • TabularUnified src/allmydata/test/mutable/test_version.py

    rc680b1d r17f0676  
    33import os
    44
    5 # BBB: Python 2 compatibility
     5# Python 2 compatibility
    66from future.utils import PY2
    77if PY2:
  • TabularUnified src/allmydata/test/test_auth.py

    rc680b1d r17f0676  
    1 # BBB: Python 2 compatibility
     1# Python 2 compatibility
    22from future.utils import PY2
    33if PY2:
  • TabularUnified src/allmydata/test/test_client.py

    rc680b1d r17f0676  
    253253        """
    254254        config = client.config_from_string(
    255             b"test_storage_default_anonymous_enabled",
    256             b"tub.port",
     255            "test_storage_default_anonymous_enabled",
     256            "tub.port",
    257257            BASECONFIG + (
    258                 b"[storage]\n"
    259                 b"enabled = true\n"
     258                "[storage]\n"
     259                "enabled = true\n"
    260260            )
    261261        )
     
    269269        config = client.config_from_string(
    270270            self.id(),
    271             b"tub.port",
     271            "tub.port",
    272272            BASECONFIG + (
    273                 b"[storage]\n"
    274                 b"enabled = true\n"
    275                 b"anonymous = true\n"
     273                "[storage]\n"
     274                "enabled = true\n"
     275                "anonymous = true\n"
    276276            )
    277277        )
     
    285285        config = client.config_from_string(
    286286            self.id(),
    287             b"tub.port",
     287            "tub.port",
    288288            BASECONFIG + (
    289                 b"[storage]\n"
    290                 b"enabled = true\n"
    291                 b"anonymous = false\n"
     289                "[storage]\n"
     290                "enabled = true\n"
     291                "anonymous = false\n"
    292292            )
    293293        )
     
    301301        config = client.config_from_string(
    302302            self.id(),
    303             b"tub.port",
     303            "tub.port",
    304304            BASECONFIG + (
    305                 b"[storage]\n"
    306                 b"enabled = false\n"
    307                 b"anonymous = true\n"
     305                "[storage]\n"
     306                "enabled = false\n"
     307                "anonymous = true\n"
    308308            )
    309309        )
     
    681681        config = client.config_from_string(
    682682            basedir,
    683             b"tub.port",
     683            "tub.port",
    684684            BASECONFIG_I % (SOME_FURL,) + (
    685                 b"[storage]\n"
    686                 b"enabled = true\n"
    687                 b"anonymous = true\n"
     685                "[storage]\n"
     686                "enabled = true\n"
     687                "anonymous = true\n"
    688688            )
    689689        )
     
    712712        config = client.config_from_string(
    713713            basedir,
    714             b"tub.port",
     714            "tub.port",
    715715            BASECONFIG_I % (SOME_FURL,) + (
    716                 b"[storage]\n"
    717                 b"enabled = true\n"
    718                 b"anonymous = false\n"
     716                "[storage]\n"
     717                "enabled = true\n"
     718                "anonymous = false\n"
    719719            )
    720720        )
     
    733733        )
    734734        self.expectThat(
    735             config.get_private_config(b"storage.furl", default=None),
     735            config.get_private_config("storage.furl", default=None),
    736736            Is(None),
    737737        )
     
    749749        enabled_config = client.config_from_string(
    750750            basedir,
    751             b"tub.port",
     751            "tub.port",
    752752            BASECONFIG_I % (SOME_FURL,) + (
    753                 b"[storage]\n"
    754                 b"enabled = true\n"
    755                 b"anonymous = true\n"
     753                "[storage]\n"
     754                "enabled = true\n"
     755                "anonymous = true\n"
    756756            )
    757757        )
     
    760760            _introducer_factory=MemoryIntroducerClient,
    761761        )
    762         anonymous_storage_furl = enabled_config.get_private_config(b"storage.furl")
     762        anonymous_storage_furl = enabled_config.get_private_config("storage.furl")
    763763        def check_furl():
    764764            return node.tub.getReferenceForURL(anonymous_storage_furl)
     
    773773        disabled_config = client.config_from_string(
    774774            basedir,
    775             b"tub.port",
     775            "tub.port",
    776776            BASECONFIG_I % (SOME_FURL,) + (
    777                 b"[storage]\n"
    778                 b"enabled = true\n"
    779                 b"anonymous = false\n"
     777                "[storage]\n"
     778                "enabled = true\n"
     779                "anonymous = false\n"
    780780            )
    781781        )
     
    11381138
    11391139
    1140     def get_config(self, storage_enabled, more_storage=b"", more_sections=b""):
    1141         return b"""
     1140    def get_config(self, storage_enabled, more_storage="", more_sections=""):
     1141        return """
    11421142[node]
    11431143tub.location = tcp:192.0.2.0:1234
     
    11641164        config = client.config_from_string(
    11651165            self.basedir,
    1166             u"tub.port",
     1166            "tub.port",
    11671167            self.get_config(storage_enabled=False),
    11681168        )
     
    11861186        config = client.config_from_string(
    11871187            self.basedir,
    1188             u"tub.port",
     1188            "tub.port",
    11891189            self.get_config(storage_enabled=True),
    11901190        )
     
    12181218        config = client.config_from_string(
    12191219            self.basedir,
    1220             u"tub.port",
     1220            "tub.port",
    12211221            self.get_config(
    12221222                storage_enabled=True,
    1223                 more_storage=b"plugins=tahoe-lafs-dummy-v1",
     1223                more_storage="plugins=tahoe-lafs-dummy-v1",
    12241224                more_sections=(
    1225                     b"[storageserver.plugins.tahoe-lafs-dummy-v1]\n"
    1226                     b"some = {}\n".format(value)
     1225                    "[storageserver.plugins.tahoe-lafs-dummy-v1]\n"
     1226                    "some = {}\n".format(value)
    12271227                ),
    12281228            ),
     
    12591259        config = client.config_from_string(
    12601260            self.basedir,
    1261             u"tub.port",
     1261            "tub.port",
    12621262            self.get_config(
    12631263                storage_enabled=True,
    1264                 more_storage=b"plugins=tahoe-lafs-dummy-v1,tahoe-lafs-dummy-v2",
     1264                more_storage="plugins=tahoe-lafs-dummy-v1,tahoe-lafs-dummy-v2",
    12651265                more_sections=(
    1266                     b"[storageserver.plugins.tahoe-lafs-dummy-v1]\n"
    1267                     b"some = thing-1\n"
    1268                     b"[storageserver.plugins.tahoe-lafs-dummy-v2]\n"
    1269                     b"some = thing-2\n"
     1266                    "[storageserver.plugins.tahoe-lafs-dummy-v1]\n"
     1267                    "some = thing-1\n"
     1268                    "[storageserver.plugins.tahoe-lafs-dummy-v2]\n"
     1269                    "some = thing-2\n"
    12701270                ),
    12711271            ),
     
    13071307        config = client.config_from_string(
    13081308            self.basedir,
    1309             u"tub.port",
     1309            "tub.port",
    13101310            self.get_config(
    13111311                storage_enabled=True,
    1312                 more_storage=b"plugins=tahoe-lafs-dummy-v1",
     1312                more_storage="plugins=tahoe-lafs-dummy-v1",
    13131313                more_sections=(
    1314                     b"[storageserver.plugins.tahoe-lafs-dummy-v1]\n"
    1315                     b"some = thing\n"
     1314                    "[storageserver.plugins.tahoe-lafs-dummy-v1]\n"
     1315                    "some = thing\n"
    13161316                ),
    13171317            ),
     
    13431343        config = client.config_from_string(
    13441344            self.basedir,
    1345             u"tub.port",
     1345            "tub.port",
    13461346            self.get_config(
    13471347                storage_enabled=True,
    1348                 more_storage=b"plugins=tahoe-lafs-dummy-v1",
     1348                more_storage="plugins=tahoe-lafs-dummy-v1",
    13491349            ),
    13501350        )
     
    13811381        config = client.config_from_string(
    13821382            self.basedir,
    1383             u"tub.port",
     1383            "tub.port",
    13841384            self.get_config(
    13851385                storage_enabled=True,
    1386                 more_storage=b"plugins=tahoe-lafs-dummy-v1",
     1386                more_storage="plugins=tahoe-lafs-dummy-v1",
    13871387                more_sections=(
    1388                     b"[storageserver.plugins.tahoe-lafs-dummy-v1]\n"
     1388                    "[storageserver.plugins.tahoe-lafs-dummy-v1]\n"
    13891389                    # This will make it explode on instantiation.
    1390                     b"invalid = configuration\n"
     1390                    "invalid = configuration\n"
    13911391                )
    13921392            ),
     
    14081408        config = client.config_from_string(
    14091409            self.basedir,
    1410             u"tub.port",
     1410            "tub.port",
    14111411            self.get_config(
    14121412                storage_enabled=True,
    1413                 more_storage=b"plugins=tahoe-lafs-dummy-vX",
     1413                more_storage="plugins=tahoe-lafs-dummy-vX",
    14141414            ),
    14151415        )
  • TabularUnified src/allmydata/test/test_crawler.py

    rc680b1d r17f0676  
    2828from allmydata.storage.crawler import ShareCrawler, TimeSliceExceeded
    2929
    30 from allmydata.test.common_py3 import FakeCanary
    31 from allmydata.test.common_util import StallMixin
     30from allmydata.test.common_util import StallMixin, FakeCanary
    3231
    3332class BucketEnumeratingCrawler(ShareCrawler):
  • TabularUnified src/allmydata/test/test_deepcheck.py

    rc680b1d r17f0676  
    11import os, json, urllib
    22
    3 # BBB: Python 2 compatibility
     3# Python 2 compatibility
    44# Can't use `builtins.str` because something deep in Twisted callbacks ends up repr'ing
    55# a `future.types.newstr.newstr` as a *Python 3* byte string representation under
  • TabularUnified src/allmydata/test/test_encodingutil.py

    rc680b1d r17f0676  
    7878from twisted.python.filepath import FilePath
    7979
    80 from allmydata.test.common_py3 import (
     80from allmydata.test.common_util import (
    8181    ReallyEqualMixin, skip_if_cannot_represent_filename,
    8282)
  • TabularUnified src/allmydata/test/test_happiness.py

    rc680b1d r17f0676  
    2424from allmydata.util.happinessutil import servers_of_happiness, \
    2525    shares_by_server, merge_servers
    26 from allmydata.test.common_py3 import ShouldFailMixin
     26from allmydata.test.common import ShouldFailMixin
    2727
    2828
  • TabularUnified src/allmydata/test/test_iputil.py

    rc680b1d r17f0676  
    2424
    2525from allmydata.util import iputil, gcutil
    26 import allmydata.test.common_py3 as testutil
     26import allmydata.test.common_util as testutil
    2727from allmydata.util.namespace import Namespace
    2828
  • TabularUnified src/allmydata/test/test_node.py

    rc680b1d r17f0676  
    521521[i2p]
    522522enabled = false
    523 [node]
    524523"""
    525524
     
    567566        with open(os.path.join(basedir, "tahoe.cfg"), "w") as f:
    568567            f.write(BASE_CONFIG)
     568            f.write("[node]\n")
    569569            f.write("tub.port = tcp:0\n")
    570570            f.write("tub.location = AUTO\n")
     
    595595        with open(os.path.join(basedir, "tahoe.cfg"), "w") as f:
    596596            f.write(BASE_CONFIG)
     597            f.write("[node]\n")
    597598            f.write("tub.port = %s\n" % port)
    598599            f.write("tub.location = %s\n" % location)
     
    618619        with open(config_fname, "w") as f:
    619620            f.write(BASE_CONFIG)
     621            f.write("[node]\n")
    620622            f.write("tub.port = listen:i2p,listen:tor\n")
    621623            f.write("tub.location = tcp:example.org:1234\n")
  • TabularUnified src/allmydata/test/test_storage.py

    rc680b1d r17f0676  
    5252    _StorageServer,
    5353)
    54 from .common_py3 import FakeCanary, LoggingServiceParent, ShouldFailMixin
     54from .common import LoggingServiceParent, ShouldFailMixin
     55from .common_util import FakeCanary
    5556
    5657
  • TabularUnified src/allmydata/test/test_storage_web.py

    rc680b1d r17f0676  
    5151    remove_prefix
    5252)
    53 from .common_py3 import FakeCanary
     53from .common_util import FakeCanary
    5454
    5555def remove_tags(s):
  • TabularUnified src/allmydata/test/test_time_format.py

    rc680b1d r17f0676  
    1717from twisted.trial import unittest
    1818
    19 from allmydata.test.common_py3 import TimezoneMixin
     19from allmydata.test.common_util import TimezoneMixin
    2020from allmydata.util import time_format
    2121
  • TabularUnified src/allmydata/test/test_upload.py

    rc680b1d r17f0676  
    2929from allmydata.util.deferredutil import DeferredListShouldSucceed
    3030from allmydata.test.no_network import GridTestMixin
    31 from allmydata.test.common_py3 import ShouldFailMixin
    3231from allmydata.storage_client import StorageFarmBroker
    3332from allmydata.storage.server import storage_index_to_dir
     
    3534from .common import (
    3635    EMPTY_CLIENT_CONFIG,
     36    ShouldFailMixin,
    3737)
    3838from functools import reduce
  • TabularUnified src/allmydata/test/web/test_introducer.py

    rc680b1d r17f0676  
    3434    SameProcessStreamEndpointAssigner,
    3535)
    36 from ..common_py3 import (
     36from ..common_util import (
    3737    FakeCanary,
    3838)
  • TabularUnified src/allmydata/test/web/test_web.py

    rc680b1d r17f0676  
    5353from allmydata.mutable import servermap, publish, retrieve
    5454from .. import common_util as testutil
    55 from ..common_py3 import TimezoneMixin
     55from ..common_util import TimezoneMixin
    5656from ..common_web import (
    5757    do_http,
  • TabularUnified src/allmydata/util/_python3.py

    rc680b1d r17f0676  
    2525# Keep these sorted alphabetically, to reduce merge conflicts:
    2626PORTED_MODULES = [
     27    "allmydata._monkeypatch",
    2728    "allmydata.codec",
    2829    "allmydata.crypto",
     
    4142    "allmydata.immutable.downloader.share",
    4243    "allmydata.immutable.downloader.status",
     44    "allmydata.immutable.encode",
     45    "allmydata.immutable.filenode",
    4346    "allmydata.immutable.happiness_upload",
     47    "allmydata.immutable.layout",
    4448    "allmydata.immutable.literal",
     49    "allmydata.immutable.upload",
    4550    "allmydata.interfaces",
    4651    "allmydata.introducer.interfaces",
     
    5459    "allmydata.storage.server",
    5560    "allmydata.storage.shares",
    56     "allmydata.test.common_py3",
    5761    "allmydata.test.no_network",
    5862    "allmydata.uri",
Note: See TracChangeset for help on using the changeset viewer.