[Tests] Require exact match in assert_start_raises_init_eror()

This commit is contained in:
John Newbery
2018-02-07 10:38:25 -05:00
committed by MarcoFalke
parent 0ec08a672d
commit 58122736b5
6 changed files with 35 additions and 18 deletions

View File

@ -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