[Tests] Move assert_start_raises_init_error method to TestNode

This commit is contained in:
John Newbery
2018-02-07 09:36:13 -05:00
committed by MarcoFalke
parent af20f9b1d4
commit 0ec08a672d
7 changed files with 44 additions and 37 deletions

View File

@ -24,12 +24,12 @@ class UacommentTest(BitcoinTestFramework):
self.log.info("test -uacomment max length")
self.stop_node(0)
expected = "exceeds maximum length (256). Reduce the number or size of uacomments."
self.assert_start_raises_init_error(0, ["-uacomment=" + 'a' * 256], expected)
self.nodes[0].assert_start_raises_init_error(["-uacomment=" + 'a' * 256], expected)
self.log.info("test -uacomment unsafe characters")
for unsafe_char in ['/', ':', '(', ')']:
expected = "User Agent comment (" + unsafe_char + ") contains unsafe characters"
self.assert_start_raises_init_error(0, ["-uacomment=" + unsafe_char], expected)
self.nodes[0].assert_start_raises_init_error(["-uacomment=" + unsafe_char], expected)
if __name__ == '__main__':
UacommentTest().main()