From aac36fb30ac4a9dbdc8673b2f4549cfa913072b5 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 3 May 2019 12:09:03 -0400 Subject: [PATCH] fix line separator --- src/allmydata/test/test_runner.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/allmydata/test/test_runner.py b/src/allmydata/test/test_runner.py index cbf595699..3fd1f1f54 100644 --- a/src/allmydata/test/test_runner.py +++ b/src/allmydata/test/test_runner.py @@ -10,6 +10,7 @@ from unittest import ( ) import attr +from os import linesep from twisted.trial import unittest @@ -429,10 +430,13 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin, # This makes sure that node.url is written, which allows us to # detect when the introducer restarts in _node_has_restarted below. config = fileutil.read(tahoe.config_file.path) - self.assertIn('\nweb.port = \n', config) + self.assertIn('{}web.port = {}'.format(linesep, linesep), config) fileutil.write( tahoe.config_file.path, - config.replace('\nweb.port = \n', '\nweb.port = 0\n'), + config.replace( + '{}web.port = {}'.format(linesep, linesep), + '{}web.port = 0{}'.format(linesep, linesep), + ) ) p = Expect() @@ -502,7 +506,10 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin, # Check that the --webport option worked. config = fileutil.read(tahoe.config_file.path) - self.assertIn('\nweb.port = 0\n', config) + self.assertIn( + '{}web.port = 0{}'.format(linesep, linesep), + config, + ) # After this it's safe to start the node tahoe.active()