Decode config file on read and expect bytes in the stdout. Fixes an additional test on Python 3.

This commit is contained in:
Jason R. Coombs 2021-02-15 09:28:14 -05:00
parent dc883c0440
commit 3acad6544e

View File

@ -374,7 +374,7 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin):
self.failUnlessEqual(returncode, 0) self.failUnlessEqual(returncode, 0)
# Check that the --webport option worked. # Check that the --webport option worked.
config = fileutil.read(tahoe.config_file.path) config = fileutil.read(tahoe.config_file.path).decode('utf-8')
self.assertIn( self.assertIn(
'{}web.port = 0{}'.format(linesep, linesep), '{}web.port = 0{}'.format(linesep, linesep),
config, config,
@ -387,7 +387,7 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin):
# This will run until we stop it. # This will run until we stop it.
tahoe.run(on_stdout(p)) tahoe.run(on_stdout(p))
# Wait for startup to have proceeded to a reasonable point. # Wait for startup to have proceeded to a reasonable point.
yield p.expect("client running") yield p.expect(b"client running")
tahoe.active() tahoe.active()
# read the storage.furl file so we can check that its contents don't # read the storage.furl file so we can check that its contents don't
@ -406,7 +406,7 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin):
# We don't have to add another cleanup for this one, the one from # We don't have to add another cleanup for this one, the one from
# above is still registered. # above is still registered.
tahoe.run(on_stdout(p)) tahoe.run(on_stdout(p))
yield p.expect("client running") yield p.expect(b"client running")
tahoe.active() tahoe.active()
self.assertEqual( self.assertEqual(