From 0ec08a672dce3f619e46d0c7455e95a13dc5c4e2 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Wed, 7 Feb 2018 09:36:13 -0500 Subject: [Tests] Move assert_start_raises_init_error method to TestNode --- test/functional/feature_logging.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/feature_logging.py') diff --git a/test/functional/feature_logging.py b/test/functional/feature_logging.py index da4e7b0398..65a03e50ad 100755 --- a/test/functional/feature_logging.py +++ b/test/functional/feature_logging.py @@ -30,7 +30,7 @@ class LoggingTest(BitcoinTestFramework): invdir = os.path.join(self.nodes[0].datadir, "regtest", "foo") invalidname = os.path.join("foo", "foo.log") self.stop_node(0) - self.assert_start_raises_init_error(0, ["-debuglogfile=%s" % (invalidname)], + self.nodes[0].assert_start_raises_init_error(["-debuglogfile=%s" % (invalidname)], "Error: Could not open debug log file") assert not os.path.isfile(os.path.join(invdir, "foo.log")) @@ -44,7 +44,7 @@ class LoggingTest(BitcoinTestFramework): self.stop_node(0) invdir = os.path.join(self.options.tmpdir, "foo") invalidname = os.path.join(invdir, "foo.log") - self.assert_start_raises_init_error(0, ["-debuglogfile=%s" % invalidname], + self.nodes[0].assert_start_raises_init_error(["-debuglogfile=%s" % invalidname], "Error: Could not open debug log file") assert not os.path.isfile(os.path.join(invdir, "foo.log")) -- cgit v1.2.3 From 58122736b53390a2013630e95ff760800af160e7 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Wed, 7 Feb 2018 10:38:25 -0500 Subject: [Tests] Require exact match in assert_start_raises_init_eror() --- test/functional/feature_logging.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'test/functional/feature_logging.py') diff --git a/test/functional/feature_logging.py b/test/functional/feature_logging.py index 65a03e50ad..a4ebc7cca3 100755 --- a/test/functional/feature_logging.py +++ b/test/functional/feature_logging.py @@ -30,8 +30,8 @@ class LoggingTest(BitcoinTestFramework): invdir = os.path.join(self.nodes[0].datadir, "regtest", "foo") invalidname = os.path.join("foo", "foo.log") self.stop_node(0) - self.nodes[0].assert_start_raises_init_error(["-debuglogfile=%s" % (invalidname)], - "Error: Could not open debug log file") + exp_stderr = "Error: Could not open debug log file \S+$" + self.nodes[0].assert_start_raises_init_error(["-debuglogfile=%s" % (invalidname)], exp_stderr) assert not os.path.isfile(os.path.join(invdir, "foo.log")) # check that invalid log (relative) works after path exists @@ -44,8 +44,7 @@ class LoggingTest(BitcoinTestFramework): self.stop_node(0) invdir = os.path.join(self.options.tmpdir, "foo") invalidname = os.path.join(invdir, "foo.log") - self.nodes[0].assert_start_raises_init_error(["-debuglogfile=%s" % invalidname], - "Error: Could not open debug log file") + self.nodes[0].assert_start_raises_init_error(["-debuglogfile=%s" % invalidname], exp_stderr) assert not os.path.isfile(os.path.join(invdir, "foo.log")) # check that invalid log (absolute) works after path exists -- cgit v1.2.3