aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_uacomment.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2018-02-07 10:38:25 -0500
committerMarcoFalke <falke.marco@gmail.com>2018-03-18 13:32:50 -0400
commit58122736b53390a2013630e95ff760800af160e7 (patch)
tree386b714cff790ba9fae18135bb91c13455802e09 /test/functional/feature_uacomment.py
parent0ec08a672dce3f619e46d0c7455e95a13dc5c4e2 (diff)
downloadbitcoin-58122736b53390a2013630e95ff760800af160e7.tar.xz
[Tests] Require exact match in assert_start_raises_init_eror()
Diffstat (limited to 'test/functional/feature_uacomment.py')
-rwxr-xr-xtest/functional/feature_uacomment.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/functional/feature_uacomment.py b/test/functional/feature_uacomment.py
index 5725b85b2c..c73bdcfbb8 100755
--- a/test/functional/feature_uacomment.py
+++ b/test/functional/feature_uacomment.py
@@ -4,9 +4,12 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -uacomment option."""
+import re
+
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
+
class UacommentTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
@@ -23,13 +26,14 @@ 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."
+ expected = "Error: Total length of network version string \([0-9]+\) exceeds maximum length \(256\). Reduce the number or size of uacomments."
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"
+ expected = "Error: User Agent comment \(" + re.escape(unsafe_char) + "\) contains unsafe characters."
self.nodes[0].assert_start_raises_init_error(["-uacomment=" + unsafe_char], expected)
+
if __name__ == '__main__':
UacommentTest().main()