mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-01 00:45:52 +00:00
Some passing tests on Python 3.
This commit is contained in:
parent
c2fe5a65a6
commit
bcd7cdf86f
@ -628,7 +628,7 @@ def storage_enabled(config):
|
||||
|
||||
: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):
|
||||
@ -1020,7 +1020,7 @@ class _Client(node.Node, pollmixin.PollMixin):
|
||||
def init_control(self):
|
||||
c = ControlServer()
|
||||
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")
|
||||
|
||||
def init_helper(self):
|
||||
|
@ -1,3 +1,5 @@
|
||||
from past.builtins import unicode
|
||||
|
||||
import time
|
||||
from zope.interface import implementer
|
||||
from twisted.application import service
|
||||
|
@ -742,7 +742,7 @@ class Node(service.MultiService):
|
||||
if self.tub is not None:
|
||||
self.nodeid = b32decode(self.tub.tubID.upper()) # binary format
|
||||
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)
|
||||
else:
|
||||
self.nodeid = self.short_nodeid = None
|
||||
|
@ -194,8 +194,8 @@ class TestCase(testutil.SignalMixin, unittest.TestCase):
|
||||
config = read_config(basedir, "portnum")
|
||||
self.assertEqual(
|
||||
config.items("node"),
|
||||
[(b"nickname", b"foo"),
|
||||
(b"timeout.disconnect", b"12"),
|
||||
[("nickname", "foo"),
|
||||
("timeout.disconnect", "12"),
|
||||
],
|
||||
)
|
||||
|
||||
@ -545,7 +545,7 @@ enabled = true
|
||||
|
||||
class FakeTub(object):
|
||||
def __init__(self):
|
||||
self.tubID = base64.b32encode("foo")
|
||||
self.tubID = base64.b32encode(b"foo")
|
||||
self.listening_ports = []
|
||||
def setOption(self, name, value): pass
|
||||
def removeAllConnectionHintHandlers(self): pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user