[Pkg-privacy-commits] [txtorcon] 27/49: private arg
Ximin Luo
infinity0 at debian.org
Mon Oct 19 13:49:52 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository txtorcon.
commit 17e9b866109a838ba87f215bd973bd7c9fcbe557
Author: meejah <meejah at meejah.ca>
Date: Sat Jun 20 23:31:43 2015 -0600
private arg
---
test/test_endpoints.py | 14 +++++++-------
txtorcon/endpoints.py | 10 +++++-----
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/test/test_endpoints.py b/test/test_endpoints.py
index bedafaf..d538da3 100644
--- a/test/test_endpoints.py
+++ b/test/test_endpoints.py
@@ -571,7 +571,7 @@ class TestTorClientEndpoint(unittest.TestCase):
def FailTorSocksEndpointGenerator(*args, **kw):
kw['failure'] = connectionRefusedFailure
return FakeTorSocksEndpoint(*args, **kw)
- endpoint = TorClientEndpoint('', 0, proxy_endpoint_generator=FailTorSocksEndpointGenerator)
+ endpoint = TorClientEndpoint('', 0, _proxy_endpoint_generator=FailTorSocksEndpointGenerator)
d = endpoint.connect(None)
return self.assertFailure(d, ConnectionRefusedError)
@@ -585,7 +585,7 @@ class TestTorClientEndpoint(unittest.TestCase):
endpoint = TorClientEndpoint(
'invalid host', 0,
socks_username='billy', socks_password='s333cure',
- proxy_endpoint_generator=FailTorSocksEndpointGenerator)
+ _proxy_endpoint_generator=FailTorSocksEndpointGenerator)
d = endpoint.connect(None)
return self.assertFailure(d, ConnectionRefusedError)
@@ -622,7 +622,7 @@ class TestTorClientEndpoint(unittest.TestCase):
"""
def TorSocksEndpointGenerator(*args, **kw):
return FakeTorSocksEndpoint(*args, **kw)
- endpoint = TorClientEndpoint('', 0, proxy_endpoint_generator=TorSocksEndpointGenerator)
+ endpoint = TorClientEndpoint('', 0, _proxy_endpoint_generator=TorSocksEndpointGenerator)
endpoint.connect(None)
self.assertEqual(endpoint.tor_socks_endpoint.transport.value(), '\x05\x01\x00')
@@ -639,7 +639,7 @@ class TestTorClientEndpoint(unittest.TestCase):
kw['acceptPort'] = port
kw['failure'] = connectionRefusedFailure
return FakeTorSocksEndpoint(*args, **kw)
- endpoint = TorClientEndpoint('', 0, proxy_endpoint_generator=TorSocksEndpointGenerator)
+ endpoint = TorClientEndpoint('', 0, _proxy_endpoint_generator=TorSocksEndpointGenerator)
endpoint.connect(None)
self.assertEqual(endpoint.tor_socks_endpoint.transport.value(), '\x05\x01\x00')
@@ -653,7 +653,7 @@ class TestTorClientEndpoint(unittest.TestCase):
kw['acceptPort'] = port
kw['failure'] = connectionRefusedFailure
return FakeTorSocksEndpoint(*args, **kw)
- endpoint = TorClientEndpoint('', 0, proxy_endpoint_generator=TorSocksEndpointGenerator)
+ endpoint = TorClientEndpoint('', 0, _proxy_endpoint_generator=TorSocksEndpointGenerator)
d = endpoint.connect(None)
return self.assertFailure(d, ConnectionRefusedError)
@@ -666,7 +666,7 @@ class TestTorClientEndpoint(unittest.TestCase):
kw['acceptPort'] = 6669
kw['failure'] = connectionRefusedFailure
return FakeTorSocksEndpoint(*args, **kw)
- endpoint = TorClientEndpoint('', 0, proxy_endpoint_generator=TorSocksEndpointGenerator, socks_port=6669)
+ endpoint = TorClientEndpoint('', 0, _proxy_endpoint_generator=TorSocksEndpointGenerator, socks_port=6669)
endpoint.connect(None)
self.assertEqual(endpoint.tor_socks_endpoint.transport.value(), '\x05\x01\x00')
@@ -680,6 +680,6 @@ class TestTorClientEndpoint(unittest.TestCase):
kw['acceptPort'] = 9050
kw['failure'] = connectionRefusedFailure
return FakeTorSocksEndpoint(*args, **kw)
- endpoint = TorClientEndpoint('', 0, proxy_endpoint_generator=TorSocksEndpointGenerator, socks_port=6669)
+ endpoint = TorClientEndpoint('', 0, _proxy_endpoint_generator=TorSocksEndpointGenerator, socks_port=6669)
d = endpoint.connect(None)
self.assertFailure(d, ConnectionRefusedError)
diff --git a/txtorcon/endpoints.py b/txtorcon/endpoints.py
index 7288b4d..38bff66 100644
--- a/txtorcon/endpoints.py
+++ b/txtorcon/endpoints.py
@@ -605,9 +605,9 @@ class TorClientEndpoint(object):
:param port: The tcp port or Tor Hidden Service port.
- :param proxy_endpoint_generator: This is used for unit tests.
+ :param _proxy_endpoint_generator: This is used for unit tests.
- :param socksPort:
+ :param socks_port:
This optional argument lets the user specify which Tor SOCKS
port should be used.
"""
@@ -618,13 +618,13 @@ class TorClientEndpoint(object):
def __init__(self, host, port,
socks_hostname=None, socks_port=None,
socks_username=None, socks_password=None,
- proxy_endpoint_generator=default_tcp4_endpoint_generator):
+ _proxy_endpoint_generator=default_tcp4_endpoint_generator):
if host is None or port is None:
raise ValueError('host and port must be specified')
self.host = host
self.port = port
- self.proxy_endpoint_generator = proxy_endpoint_generator
+ self._proxy_endpoint_generator = _proxy_endpoint_generator
self.socks_hostname = socks_hostname
self.socks_port = socks_port
self.socks_username = socks_username
@@ -646,7 +646,7 @@ class TorClientEndpoint(object):
return d
def _try_connect(self):
- self.tor_socks_endpoint = self.proxy_endpoint_generator(
+ self.tor_socks_endpoint = self._proxy_endpoint_generator(
reactor,
self.socks_hostname,
self.socks_port
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/txtorcon.git
More information about the Pkg-privacy-commits
mailing list