From 2dd7f4083ff99c3cf8cfb490bc302da93c734ecc Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Fri, 24 Sep 2021 10:16:22 -0400 Subject: [PATCH] be compatible with old and new tahoe --- src/_zkapauthorizer/tests/test_plugin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/_zkapauthorizer/tests/test_plugin.py b/src/_zkapauthorizer/tests/test_plugin.py index 295cc55..3402596 100644 --- a/src/_zkapauthorizer/tests/test_plugin.py +++ b/src/_zkapauthorizer/tests/test_plugin.py @@ -20,7 +20,7 @@ from __future__ import ( absolute_import, ) -from io import ( +from StringIO import ( StringIO, ) from os import ( @@ -397,6 +397,11 @@ class ClientPluginTests(TestCase): b"tub.port", config_text.encode("utf-8"), ) + # On Tahoe-LAFS <1.16, the config is written as bytes. + # On Tahoe-LAFS >=1.16, the config is written as unicode. + # + # After support for Tahoe <1.16 support is dropped we probably want to + # switch to an io.StringIO here. config_text = StringIO() node_config.config.write(config_text) self.addDetail(u"config", text_content(config_text.getvalue())) -- GitLab