[tor-commits] [bridgedb/master] Rename Bridges.py to bridgerings.py.
phw at torproject.org
phw at torproject.org
Wed May 27 17:14:43 UTC 2020
commit 6ee87fb70e887c06af8f93335a6731d1bc608b9f
Author: Philipp Winter <phw at nymity.ch>
Date: Thu Mar 26 20:12:11 2020 -0700
Rename Bridges.py to bridgerings.py.
On file systems that are case insensitive (i.e., Mac OS and Windows),
these filenames are conflicting and cause a lot of development pain.
This fixes <https://bugs.torproject.org/29686>.
---
CHANGELOG | 4 ++++
bridgedb/{Bridges.py => bridgerings.py} | 4 ++--
bridgedb/bridges.py | 4 ++--
bridgedb/distributors/email/distributor.py | 8 ++++----
bridgedb/distributors/https/distributor.py | 11 ++++++-----
bridgedb/distributors/moat/distributor.py | 5 +++--
bridgedb/main.py | 18 +++++++++---------
bridgedb/persistent.py | 11 +++++++----
bridgedb/test/deprecated.py | 4 ++--
bridgedb/test/legacy_Tests.py | 12 ++++++------
bridgedb/test/test_Tests.py | 10 +++++-----
bridgedb/test/test_bridgedb_script.py | 1 +
.../test/{test_Bridges.py => test_bridgerings.py} | 22 +++++++++++-----------
bridgedb/test/test_bridges.py | 12 ++++++------
bridgedb/test/test_https_distributor.py | 4 ++--
bridgedb/test/util.py | 4 ++--
...idgedb.Bridges.rst => bridgedb.bridgerings.rst} | 6 +++---
doc/sphinx/source/bridgedb.rst | 2 +-
doc/sphinx/source/conf.py | 2 +-
19 files changed, 77 insertions(+), 67 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index a92824c..3e179e1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+ * FIXES https://bugs.torproject.org/29686
+ Rename files that contain "Bridges" to "bridgerings", to eliminate
+ headache on file systems that are case insensitive.
+
Changes in version 0.10.0 - 2020-04-01
* FIXES https://bugs.torproject.org/30317
diff --git a/bridgedb/Bridges.py b/bridgedb/bridgerings.py
similarity index 99%
rename from bridgedb/Bridges.py
rename to bridgedb/bridgerings.py
index 2126a7d..5b55610 100644
--- a/bridgedb/Bridges.py
+++ b/bridgedb/bridgerings.py
@@ -199,7 +199,7 @@ class BridgeRing(object):
If the (presumably same) bridge is already at that determined position
in this hashring, replace the old one.
- :type bridge: :class:`~bridgedb.Bridges.Bridge`
+ :type bridge: :class:`~bridgedb.bridges.Bridge`
:param bridge: The bridge to insert into this hashring.
"""
for tp, val, _, subring in self.subrings:
@@ -257,7 +257,7 @@ class BridgeRing(object):
first position after this one which has a bridge assigned to it.
:param int N: The number of bridges to return.
:rtype: list
- :returns: A list of :class:`~bridgedb.Bridges.Bridge`s.
+ :returns: A list of :class:`~bridgedb.bridges.Bridge`s.
"""
assert len(pos) == DIGEST_LEN
if N >= len(self.sortedKeys):
diff --git a/bridgedb/bridges.py b/bridgedb/bridges.py
index 1dc32af..cd01948 100644
--- a/bridgedb/bridges.py
+++ b/bridgedb/bridges.py
@@ -814,12 +814,12 @@ class BridgeBackwardsCompatibility(BridgeBase):
This method is provided for backwards compatibility and should not
be relied upon.
- The old ``bridgedb.Bridges.Bridge.getConfigLine()`` method didn't know
+ The old ``bridgedb.bridges.Bridge.getConfigLine()`` method didn't know
about :class:`~bridgedb.bridgerequest.BridgeRequestBase`s, and so this
modified version is backwards compatible by creating a
:class:`~bridgedb.bridgerequest.BridgeRequestBase` for
:meth:`getBridgeLine`. The default parameters are the same as they
- were in the old ``bridgedb.Bridges.Bridge`` class.
+ were in the old ``bridgedb.bridges.Bridge`` class.
:param bool includeFingerprint: If ``True``, include the
``fingerprint`` of this :class:`Bridge` in the returned bridge
diff --git a/bridgedb/distributors/email/distributor.py b/bridgedb/distributors/email/distributor.py
index fbf1a50..a90e725 100644
--- a/bridgedb/distributors/email/distributor.py
+++ b/bridgedb/distributors/email/distributor.py
@@ -29,8 +29,8 @@ import time
import bridgedb.Storage
-from bridgedb.Bridges import BridgeRing
-from bridgedb.Bridges import FilteredBridgeSplitter
+from bridgedb.bridgerings import BridgeRing
+from bridgedb.bridgerings import FilteredBridgeSplitter
from bridgedb.crypto import getHMAC
from bridgedb.crypto import getHMACFunc
from bridgedb.distribute import Distributor
@@ -67,7 +67,7 @@ class EmailDistributor(Distributor):
"""Object that hands out bridges based on the email address of an incoming
request and the current time period.
- :type hashring: :class:`~bridgedb.Bridges.BridgeRing`
+ :type hashring: :class:`~bridgedb.bridgerings.BridgeRing`
:ivar hashring: A hashring to hold all the bridges we hand out.
"""
@@ -135,7 +135,7 @@ class EmailDistributor(Distributor):
than :api:`time.time`. This should likely only be used for
testing.
:rtype: :any:`list` or ``None``
- :returns: A list of :class:`~bridgedb.bridges.Bridges` for the
+ :returns: A list of :class:`~bridgedb.bridges.Bridge` for the
``bridgeRequest.client``, if allowed. Otherwise, returns ``None``.
"""
if (not bridgeRequest.client) or (bridgeRequest.client == 'default'):
diff --git a/bridgedb/distributors/https/distributor.py b/bridgedb/distributors/https/distributor.py
index f3e2e9b..d01a252 100644
--- a/bridgedb/distributors/https/distributor.py
+++ b/bridgedb/distributors/https/distributor.py
@@ -27,8 +27,8 @@ import logging
import bridgedb.Storage
from bridgedb import proxy
-from bridgedb.Bridges import BridgeRing
-from bridgedb.Bridges import FilteredBridgeSplitter
+from bridgedb.bridgerings import BridgeRing
+from bridgedb.bridgerings import FilteredBridgeSplitter
from bridgedb.crypto import getHMAC
from bridgedb.crypto import getHMACFunc
from bridgedb.distribute import Distributor
@@ -45,7 +45,7 @@ class HTTPSDistributor(Distributor):
:type proxies: :class:`~bridgedb.proxies.ProxySet`
:ivar proxies: All known proxies, which we treat differently. See
:param:`proxies`.
- :type hashring: :class:`bridgedb.Bridges.FilteredBridgeSplitter`
+ :type hashring: :class:`bridgedb.bridgerings.FilteredBridgeSplitter`
:ivar hashring: A hashring that assigns bridges to subrings with fixed
proportions. Used to assign bridges into the subrings of this
distributor.
@@ -69,7 +69,8 @@ class HTTPSDistributor(Distributor):
the extra cluster, and any client requesting bridges from one of
these **proxies** will be distributed bridges from a separate
subhashring that is specific to Tor/proxy users.
- :type answerParameters: :class:`bridgedb.Bridges.BridgeRingParameters`
+ :type answerParameters:
+ :class:`bridgedb.bridgerings.BridgeRingParameters`
:param answerParameters: A mechanism for ensuring that the set of
bridges that this distributor answers a client with fit certain
parameters, i.e. that an answer has "at least two obfsproxy
@@ -293,7 +294,7 @@ class HTTPSDistributor(Distributor):
:param str interval: The time period when we got this request. This
can be any string, so long as it changes with every period.
:rtype: list
- :return: A list of :class:`~bridgedb.Bridges.Bridge`s to include in
+ :return: A list of :class:`~bridgedb.bridges.Bridge`s to include in
the response. See
:meth:`bridgedb.distributors.https.server.WebResourceBridges.getBridgeRequestAnswer`
for an example of how this is used.
diff --git a/bridgedb/distributors/moat/distributor.py b/bridgedb/distributors/moat/distributor.py
index a8f0e1d..c4687eb 100644
--- a/bridgedb/distributors/moat/distributor.py
+++ b/bridgedb/distributors/moat/distributor.py
@@ -30,7 +30,7 @@ class MoatDistributor(HTTPSDistributor):
:type proxies: :class:`~bridgedb.proxies.ProxySet`
:ivar proxies: All known proxies, which we treat differently. See
:param:`proxies`.
- :type hashring: :class:`bridgedb.Bridges.FilteredBridgeSplitter`
+ :type hashring: :class:`bridgedb.bridgerings.FilteredBridgeSplitter`
:ivar hashring: A hashring that assigns bridges to subrings with fixed
proportions. Used to assign bridges into the subrings of this
distributor.
@@ -54,7 +54,8 @@ class MoatDistributor(HTTPSDistributor):
the extra cluster, and any client requesting bridges from one of
these **proxies** will be distributed bridges from a separate
subhashring that is specific to Tor/proxy users.
- :type answerParameters: :class:`bridgedb.Bridges.BridgeRingParameters`
+ :type answerParameters:
+ :class:`bridgedb.bridgerings.BridgeRingParameters`
:param answerParameters: A mechanism for ensuring that the set of
bridges that this distributor answers a client with fit certain
parameters, i.e. that an answer has "at least two obfsproxy
diff --git a/bridgedb/main.py b/bridgedb/main.py
index bc309c5..70001a9 100644
--- a/bridgedb/main.py
+++ b/bridgedb/main.py
@@ -41,7 +41,7 @@ from bridgedb.parse.blacklist import parseBridgeBlacklistFile
import bridgedb.Storage
-from bridgedb import Bridges
+from bridgedb import bridgerings
from bridgedb.Stability import updateBridgeHistory
@@ -59,7 +59,7 @@ def expandBridgeAuthDir(authdir, filename):
def writeAssignments(hashring, filename):
"""Dump bridge distributor assignments to disk.
- :type hashring: A :class:`~bridgedb.Bridges.BridgeSplitter`
+ :type hashring: A :class:`~bridgedb.bridgerings.BridgeSplitter`
:ivar hashring: A class which takes an HMAC key and splits bridges
into their hashring assignments.
:param str filename: The filename to write the assignments to.
@@ -98,7 +98,7 @@ def load(state, hashring, clear=False):
store them into our ``state.hashring`` instance. The ``state`` will be
saved again at the end of this function.
- :type hashring: :class:`~bridgedb.Bridges.BridgeSplitter`
+ :type hashring: :class:`~bridgedb.bridgerings.BridgeSplitter`
:param hashring: A class which provides a mechanism for HMACing
Bridges in order to assign them to hashrings.
:param boolean clear: If True, clear all previous bridges from the
@@ -248,19 +248,19 @@ def createBridgeRings(cfg, proxyList, key):
known open proxies.
:param bytes key: Hashring master key
:rtype: tuple
- :returns: A :class:`~bridgedb.Bridges.BridgeSplitter` hashring, an
+ :returns: A :class:`~bridgedb.bridgerings.BridgeSplitter` hashring, an
:class:`~bridgedb.distributors.https.distributor.HTTPSDistributor` or None, and an
:class:`~bridgedb.distributors.email.distributor.EmailDistributor` or None, and an
:class:`~bridgedb.distributors.moat.distributor.MoatDistributor` or None.
"""
# Create a BridgeSplitter to assign the bridges to the different
# distributors.
- hashring = Bridges.BridgeSplitter(crypto.getHMAC(key, "Hashring-Key"))
+ hashring = bridgerings.BridgeSplitter(crypto.getHMAC(key, "Hashring-Key"))
logging.debug("Created hashring: %r" % hashring)
# Create ring parameters.
- ringParams = Bridges.BridgeRingParameters(needPorts=cfg.FORCE_PORTS,
- needFlags=cfg.FORCE_FLAGS)
+ ringParams = bridgerings.BridgeRingParameters(needPorts=cfg.FORCE_PORTS,
+ needFlags=cfg.FORCE_FLAGS)
emailDistributor = ipDistributor = moatDistributor = None
@@ -297,7 +297,7 @@ def createBridgeRings(cfg, proxyList, key):
# As appropriate, tell the hashring to leave some bridges unallocated.
if cfg.RESERVED_SHARE:
- hashring.addRing(Bridges.UnallocatedHolder(),
+ hashring.addRing(bridgerings.UnallocatedHolder(),
"unallocated",
cfg.RESERVED_SHARE)
@@ -394,7 +394,7 @@ def run(options, reactor=reactor):
:ivar cfg: The current configuration, including any in-memory
settings (i.e. settings whose values were not obtained from the
config file, but were set via a function somewhere)
- :type hashring: A :class:`~bridgedb.Bridges.BridgeSplitter`
+ :type hashring: A :class:`~bridgedb.bridgerings.BridgeSplitter`
:ivar hashring: A class which takes an HMAC key and splits bridges
into their hashring assignments.
"""
diff --git a/bridgedb/persistent.py b/bridgedb/persistent.py
index 3d52ec5..c572758 100644
--- a/bridgedb/persistent.py
+++ b/bridgedb/persistent.py
@@ -23,7 +23,7 @@ except (ImportError, NameError): # pragma: no cover
from twisted.python.reflect import safe_repr
from twisted.spread import jelly
-from bridgedb import Bridges
+from bridgedb import bridgerings
from bridgedb import filters
from bridgedb.distributors.email import distributor as emailDistributor
from bridgedb.distributors.https import distributor as httpsDistributor
@@ -35,7 +35,10 @@ _state = None
#: Types and classes which are allowed to be jellied:
_security = jelly.SecurityOptions()
#_security.allowInstancesOf(ProxySet)
-_security.allowModules(filters, Bridges, emailDistributor, httpsDistributor)
+_security.allowModules(filters,
+ bridgerings,
+ emailDistributor,
+ httpsDistributor)
class MissingState(Exception):
@@ -91,8 +94,8 @@ class State(jelly.Jellyable):
modules which are known to be unjelliable/unpicklable so far are:
- bridgedb.Dist
- - bridgedb.Bridges, and all "splitter" and "ring" classes contained
- within
+ - bridgedb.bridgerings, and all "splitter" and "ring" classes
+ contained within
:property statefile: The filename to retrieve a pickled, jellied
:class:`~bridgedb.persistent.State` instance from. (default:
diff --git a/bridgedb/test/deprecated.py b/bridgedb/test/deprecated.py
index 1a71bf1..0ddd9e3 100644
--- a/bridgedb/test/deprecated.py
+++ b/bridgedb/test/deprecated.py
@@ -282,7 +282,7 @@ class Bridge(object):
class PluggableTransport(object):
"""A PT with reference to the parent bridge on which it is running.
- Deprecated :class:`bridgedb.Bridges.PluggableTransport`, replaced in
+ Deprecated :class:`bridgedb.bridgerings.PluggableTransport`, replaced in
bridgedb-0.2.4, by :class:`bridgedb.bridges.PluggableTransport`.
"""
@@ -392,7 +392,7 @@ class PluggableTransport(object):
Version('bridgedb', 0, 0, 1),
replacement='bridgedb.parse.addr.PortList')
class PortList:
- """Deprecated :class:`bridgedb.Bridges.PortList`, replaced in
+ """Deprecated :class:`bridgedb.bridgerings.PortList`, replaced in
bridgedb-0.1.0, in commit 1f111e5, by
:class:`bridgedb.parse.addr.PortList`.
diff --git a/bridgedb/test/legacy_Tests.py b/bridgedb/test/legacy_Tests.py
index 93b52a7..55a8315 100644
--- a/bridgedb/test/legacy_Tests.py
+++ b/bridgedb/test/legacy_Tests.py
@@ -17,7 +17,7 @@ import warnings
import time
from datetime import datetime
-import bridgedb.Bridges
+import bridgedb.bridgerings
import bridgedb.main
import bridgedb.schedule
import bridgedb.Storage
@@ -62,7 +62,7 @@ def fakeBridge(orport=8080, running=True, stable=True, or_addresses=False,
ip = randomIPv4()
nn = "bridge-%s" % int(ip)
fp = "".join([random.choice("0123456789ABCDEF") for _ in range(40)])
- b = bridgedb.Bridges.Bridge(nn,ip,orport,fingerprint=fp)
+ b = bridgedb.bridges.Bridge(nn,ip,orport,fingerprint=fp)
b.setStatus(running, stable)
oraddrs = []
@@ -72,7 +72,7 @@ def fakeBridge(orport=8080, running=True, stable=True, or_addresses=False,
if transports:
for i in range(0,8):
- b.transports.append(bridgedb.Bridges.PluggableTransport(b,
+ b.transports.append(bridgedb.bridgerings.PluggableTransport(b,
random.choice(["obfs", "obfs2", "pt1"]),
randomIP(), randomPort()))
return b
@@ -82,7 +82,7 @@ def fakeBridge6(orport=8080, running=True, stable=True, or_addresses=False,
ip = randomIPv6()
nn = "bridge-%s" % int(ip)
fp = "".join([random.choice("0123456789ABCDEF") for _ in range(40)])
- b = bridgedb.Bridges.Bridge(nn,ip,orport,fingerprint=fp)
+ b = bridgedb.bridges.Bridge(nn,ip,orport,fingerprint=fp)
b.setStatus(running, stable)
oraddrs = []
@@ -92,7 +92,7 @@ def fakeBridge6(orport=8080, running=True, stable=True, or_addresses=False,
if transports:
for i in range(0,8):
- b.transports.append(bridgedb.Bridges.PluggableTransport(b,
+ b.transports.append(bridgedb.bridgerings.PluggableTransport(b,
random.choice(["obfs", "obfs2", "pt1"]),
randomIP(), randomPort()))
return b
@@ -115,7 +115,7 @@ class SQLStorageTests(unittest.TestCase):
def testBridgeStorage(self):
db = self.db
- B = bridgedb.Bridges.Bridge
+ B = bridgedb.bridges.Bridge
t = time.time()
cur = self.cur
diff --git a/bridgedb/test/test_Tests.py b/bridgedb/test/test_Tests.py
index 41bd4ca..89b7d94 100644
--- a/bridgedb/test/test_Tests.py
+++ b/bridgedb/test/test_Tests.py
@@ -71,23 +71,23 @@ def monkeypatchTests():
:func:`~bridgedb.parse.networkstatus.parseALine`, with the older,
:func:`deprecated one <deprecated.parseORAddressLine>` (the
old function was previously located at
- ``bridgedb.Bridges.parseORAddressLine``).
+ ``bridgedb.bridgerings.parseORAddressLine``).
The second patch replaces the new :class:`~bridgedb.parse.addr.PortList`,
with the :class:`older one <deprecated.PortList>` (which
- was previously located at ``bridgedb.Bridges.PortList``).
+ was previously located at ``bridgedb.bridgerings.PortList``).
The third, forth, and fifth monkeypatches add some module-level attributes
- back into :mod:`bridgedb.Bridges`.
+ back into :mod:`bridgedb.bridgerings`.
:rtype: :api:`~twisted.python.monkey.MonkeyPatcher`
:returns: A :api:`~twisted.python.monkey.MonkeyPatcher`, preloaded with
patches from :mod:`deprecated`.
"""
patcher = monkey.MonkeyPatcher()
- patcher.addPatch(Tests.bridgedb.Bridges, 'PluggableTransport',
+ patcher.addPatch(Tests.bridgedb.bridgerings, 'PluggableTransport',
deprecated.PluggableTransport)
- patcher.addPatch(Tests.bridgedb.Bridges, 'Bridge',
+ patcher.addPatch(Tests.bridgedb.bridgerings, 'Bridge',
deprecated.Bridge)
return patcher
diff --git a/bridgedb/test/test_bridgedb_script.py b/bridgedb/test/test_bridgedb_script.py
index fb8bb3e..76b4001 100644
--- a/bridgedb/test/test_bridgedb_script.py
+++ b/bridgedb/test/test_bridgedb_script.py
@@ -66,6 +66,7 @@ class BridgeDBCliTest(unittest.TestCase):
if not self.pid or not processExists(self.pid):
raise SkipTest("Can't run test: no BridgeDB process running.")
+ self.doSleep()
self.assertTrue(os.path.isfile(self.assignmentsFile))
def test_bridgedb_SIGHUP_assignments_log(self):
diff --git a/bridgedb/test/test_Bridges.py b/bridgedb/test/test_bridgerings.py
similarity index 92%
rename from bridgedb/test/test_Bridges.py
rename to bridgedb/test/test_bridgerings.py
index 96e6a72..cca27d5 100644
--- a/bridgedb/test/test_Bridges.py
+++ b/bridgedb/test/test_bridgerings.py
@@ -9,7 +9,7 @@
# :license: see LICENSE for licensing information
#_____________________________________________________________________________
-"""Unittests for :mod:`bridgedb.Bridges`."""
+"""Unittests for :mod:`bridgedb.bridgerings`."""
from __future__ import print_function
@@ -24,7 +24,7 @@ from twisted.trial import unittest
import bridgedb.Storage
-from bridgedb import Bridges
+from bridgedb import bridgerings
from bridgedb import crypto
from bridgedb.test import util
from bridgedb.distributors.https.distributor import HTTPSDistributor
@@ -33,14 +33,14 @@ from bridgedb.distributors.moat.distributor import MoatDistributor
# For additional logger output for debugging, comment out the following:
logging.disable(50)
# and then uncomment the following line:
-#Bridges.logging.getLogger().setLevel(10)
+#bridgerings.logging.getLogger().setLevel(10)
class BridgeRingTests(unittest.TestCase):
- """Unittests for :class:`bridgedb.Bridges.BridgeRing`."""
+ """Unittests for :class:`bridgedb.bridgerings.BridgeRing`."""
def setUp(self):
- self.ring = Bridges.BridgeRing('fake-hmac-key')
+ self.ring = bridgerings.BridgeRing('fake-hmac-key')
def addRandomBridges(self):
bridges = copy.deepcopy(util.generateFakeBridges())
@@ -99,7 +99,7 @@ class BridgeRingTests(unittest.TestCase):
filtering by distinct subnets.
"""
self.addRandomBridges()
- bridges = self.ring.getBridges(b'a' * Bridges.DIGEST_LEN, N=3, filterBySubnet=True)
+ bridges = self.ring.getBridges(b'a' * bridgerings.DIGEST_LEN, N=3, filterBySubnet=True)
self.assertEqual(len(bridges), 3)
def test_dumpAssignments(self):
@@ -121,7 +121,7 @@ class BridgeRingTests(unittest.TestCase):
class BridgeSplitterTests(unittest.TestCase):
- """Unittests for :class:`bridgedb.Bridges.BridgeSplitter`."""
+ """Unittests for :class:`bridgedb.bridgerings.BridgeSplitter`."""
def setUp(self):
@@ -133,9 +133,9 @@ class BridgeSplitterTests(unittest.TestCase):
bridgedb.Storage.setDBFilename(self.fname)
key = 'fake-hmac-key'
- self.splitter = Bridges.BridgeSplitter(key)
- ringParams = Bridges.BridgeRingParameters(needPorts=[(443, 1)],
- needFlags=[("Stable", 1)])
+ self.splitter = bridgerings.BridgeSplitter(key)
+ ringParams = bridgerings.BridgeRingParameters(needPorts=[(443, 1)],
+ needFlags=[("Stable", 1)])
self.https_distributor = HTTPSDistributor(
4,
crypto.getHMAC(key, "HTTPS-IP-Dist-Key"),
@@ -146,7 +146,7 @@ class BridgeSplitterTests(unittest.TestCase):
crypto.getHMAC(key, "Moat-Dist-Key"),
None,
answerParameters=ringParams)
- self.unallocated_distributor = Bridges.UnallocatedHolder()
+ self.unallocated_distributor = bridgerings.UnallocatedHolder()
self.splitter.addRing(self.https_distributor.hashring, "https", p=10)
self.splitter.addRing(self.moat_distributor.hashring, "moat", p=10)
diff --git a/bridgedb/test/test_bridges.py b/bridgedb/test/test_bridges.py
index fea2d33..fd14e87 100644
--- a/bridgedb/test/test_bridges.py
+++ b/bridgedb/test/test_bridges.py
@@ -22,7 +22,7 @@ import warnings
from twisted.trial import unittest
from bridgedb import bridges
-from bridgedb.Bridges import FilteredBridgeSplitter
+from bridgedb.bridgerings import FilteredBridgeSplitter
from bridgedb.bridgerequest import BridgeRequestBase
from bridgedb.parse import descriptors
from bridgedb.parse.addr import PortList
@@ -143,14 +143,14 @@ XILT4o+SveEQUG72R4bENsKxqV4rRNh1g6CNAbYhAITqrU9B+jImDgrBBW+XWT5K
class BridgeIntegrationTests(unittest.TestCase):
"""Integration tests to ensure that the new :class:`bridgedb.bridges.Bridge`
class has compatible behaviour with the expected behaviour of the old
- :class:`bridgedb.Bridges.Bridge` class.
+ :class:`bridgedb.bridgerings.Bridge` class.
.. data: OldTest (enum)
These tests were refactored from the old tests for
``deprecated.Bridge`, which lived in
- ``lib/bridgedb/test/test_Bridges.py``. For the translations from the old
- tests in ``test_Bridges.BridgeClassTest`` to their new
+ ``lib/bridgedb/test/test_bridgerings.py``. For the translations from the
+ old tests in ``test_bridgerings.BridgeClassTest`` to their new
equivalents here in ``test_bridges.BridgeIntegrationTests``,
which should test for the same things as their old equivalents, see the
following table:
@@ -183,7 +183,7 @@ class BridgeIntegrationTests(unittest.TestCase):
def test_integration_init_0(self):
"""Ensure that we can initialise the new :class:`bridgedb.bridges.Bridge`
- class in the same manner as the old :class:`bridgedb.Bridges.Bridge`
+ class in the same manner as the old :class:`bridgedb.bridgerings.Bridge`
class. This test ensures that initialisation with a fingerprint is
successful.
"""
@@ -193,7 +193,7 @@ class BridgeIntegrationTests(unittest.TestCase):
def test_integration_init_1(self):
"""Ensure that we can initialise the new :class:`bridgedb.bridges.Bridge`
- class in the same manner as the old :class:`bridgedb.Bridges.Bridge`
+ class in the same manner as the old :class:`bridgedb.bridgerings.Bridge`
class. This test ensures that initialisation with a digest of a
bridge's ID key is successful.
"""
diff --git a/bridgedb/test/test_https_distributor.py b/bridgedb/test/test_https_distributor.py
index a96238d..c87fb1d 100644
--- a/bridgedb/test/test_https_distributor.py
+++ b/bridgedb/test/test_https_distributor.py
@@ -20,8 +20,8 @@ import random
from twisted.trial import unittest
from bridgedb.bridges import PluggableTransport
-from bridgedb.Bridges import BridgeRing
-from bridgedb.Bridges import BridgeRingParameters
+from bridgedb.bridgerings import BridgeRing
+from bridgedb.bridgerings import BridgeRingParameters
from bridgedb.filters import byIPv4
from bridgedb.filters import byIPv6
from bridgedb.distributors.https import distributor
diff --git a/bridgedb/test/util.py b/bridgedb/test/util.py
index 43219d5..75acd9a 100644
--- a/bridgedb/test/util.py
+++ b/bridgedb/test/util.py
@@ -174,7 +174,7 @@ randomValidIPString = valid(randomIPString)
_FAKE_BRIDGES = []
def generateFakeBridges(n=500):
- """Generate a set of **n** :class:`~bridgedb.bridges.Bridges` with random
+ """Generate a set of **n** :class:`~bridgedb.bridges.Bridge`s with random
data.
"""
from bridgedb.bridges import Bridge
@@ -305,7 +305,7 @@ class DummyBridge(object):
@implementer(IBridge)
class DummyMaliciousBridge(DummyBridge):
- """A mock :class:`bridgedb.Bridges.Bridge` which only supports a mocked
+ """A mock :class:`bridgedb.bridges.Bridge` which only supports a mocked
``getConfigLine`` method and which maliciously insert an additional fake
bridgeline and some javascript into its PT arguments.
"""
diff --git a/doc/sphinx/source/bridgedb.Bridges.rst b/doc/sphinx/source/bridgedb.bridgerings.rst
similarity index 50%
rename from doc/sphinx/source/bridgedb.Bridges.rst
rename to doc/sphinx/source/bridgedb.bridgerings.rst
index ad4bb6d..a27b42e 100644
--- a/doc/sphinx/source/bridgedb.Bridges.rst
+++ b/doc/sphinx/source/bridgedb.bridgerings.rst
@@ -1,7 +1,7 @@
-bridgedb.Bridges
-----------------
+bridgedb.bridgerings
+--------------------
-.. automodule:: bridgedb.Bridges
+.. automodule:: bridgedb.bridgerings
:members:
:undoc-members:
:private-members:
diff --git a/doc/sphinx/source/bridgedb.rst b/doc/sphinx/source/bridgedb.rst
index 9a8f092..c49002e 100644
--- a/doc/sphinx/source/bridgedb.rst
+++ b/doc/sphinx/source/bridgedb.rst
@@ -7,8 +7,8 @@ Packages & Modules
:toctree:
bridgedb.bridgerequest
+ bridgedb.bridgerings
bridgedb.bridges
- bridgedb.Bridges
bridgedb.captcha
bridgedb.configure
bridgedb.distribute
diff --git a/doc/sphinx/source/conf.py b/doc/sphinx/source/conf.py
index 31ae0b4..850ccbd 100644
--- a/doc/sphinx/source/conf.py
+++ b/doc/sphinx/source/conf.py
@@ -31,7 +31,7 @@ import bridgedb.main
import bridgedb.bridgerequest
import bridgedb.bridges
import bridgedb.captcha
-import bridgedb.Bridges
+import bridgedb.bridgerings
import bridgedb.crypto
import bridgedb.distribute
import bridgedb.distributors
More information about the tor-commits
mailing list