mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-19 15:53:48 +00:00
Some passing tests on Python 3.
This commit is contained in:
@ -628,7 +628,7 @@ def storage_enabled(config):
|
|||||||
|
|
||||||
:return bool: ``True`` if storage is enabled, ``False`` otherwise.
|
:return bool: ``True`` if storage is enabled, ``False`` otherwise.
|
||||||
"""
|
"""
|
||||||
return config.get_config(b"storage", b"enabled", True, boolean=True)
|
return config.get_config("storage", "enabled", True, boolean=True)
|
||||||
|
|
||||||
|
|
||||||
def anonymous_storage_enabled(config):
|
def anonymous_storage_enabled(config):
|
||||||
@ -1020,7 +1020,7 @@ class _Client(node.Node, pollmixin.PollMixin):
|
|||||||
def init_control(self):
|
def init_control(self):
|
||||||
c = ControlServer()
|
c = ControlServer()
|
||||||
c.setServiceParent(self)
|
c.setServiceParent(self)
|
||||||
control_url = self.control_tub.registerReference(c)
|
control_url = self.control_tub.registerReference(c).encode("utf-8")
|
||||||
self.config.write_private_config("control.furl", control_url + b"\n")
|
self.config.write_private_config("control.furl", control_url + b"\n")
|
||||||
|
|
||||||
def init_helper(self):
|
def init_helper(self):
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
from past.builtins import unicode
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from zope.interface import implementer
|
from zope.interface import implementer
|
||||||
from twisted.application import service
|
from twisted.application import service
|
||||||
|
@ -742,7 +742,7 @@ class Node(service.MultiService):
|
|||||||
if self.tub is not None:
|
if self.tub is not None:
|
||||||
self.nodeid = b32decode(self.tub.tubID.upper()) # binary format
|
self.nodeid = b32decode(self.tub.tubID.upper()) # binary format
|
||||||
self.short_nodeid = b32encode(self.nodeid).lower()[:8] # for printing
|
self.short_nodeid = b32encode(self.nodeid).lower()[:8] # for printing
|
||||||
self.config.write_config_file("my_nodeid", b32encode(self.nodeid).lower() + "\n")
|
self.config.write_config_file("my_nodeid", b32encode(self.nodeid).lower() + b"\n", mode="wb")
|
||||||
self.tub.setServiceParent(self)
|
self.tub.setServiceParent(self)
|
||||||
else:
|
else:
|
||||||
self.nodeid = self.short_nodeid = None
|
self.nodeid = self.short_nodeid = None
|
||||||
|
@ -194,8 +194,8 @@ class TestCase(testutil.SignalMixin, unittest.TestCase):
|
|||||||
config = read_config(basedir, "portnum")
|
config = read_config(basedir, "portnum")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
config.items("node"),
|
config.items("node"),
|
||||||
[(b"nickname", b"foo"),
|
[("nickname", "foo"),
|
||||||
(b"timeout.disconnect", b"12"),
|
("timeout.disconnect", "12"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -545,7 +545,7 @@ enabled = true
|
|||||||
|
|
||||||
class FakeTub(object):
|
class FakeTub(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.tubID = base64.b32encode("foo")
|
self.tubID = base64.b32encode(b"foo")
|
||||||
self.listening_ports = []
|
self.listening_ports = []
|
||||||
def setOption(self, name, value): pass
|
def setOption(self, name, value): pass
|
||||||
def removeAllConnectionHintHandlers(self): pass
|
def removeAllConnectionHintHandlers(self): pass
|
||||||
|
Reference in New Issue
Block a user