From 055d94d1ab4937ed0080459fbe63568dc47b6786 Mon Sep 17 00:00:00 2001 From: brunoerg Date: Thu, 19 May 2022 10:42:56 -0300 Subject: [PATCH] test: add coverage for unknown network in -onlynet --- test/functional/feature_proxy.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/functional/feature_proxy.py b/test/functional/feature_proxy.py index 8541c3ed882..50e0e2c4cc1 100755 --- a/test/functional/feature_proxy.py +++ b/test/functional/feature_proxy.py @@ -36,6 +36,7 @@ addnode connect to a CJDNS address - Test passing invalid -i2psam - Test passing -onlynet=onion without -proxy or -onion - Test passing -onlynet=onion with -onion=0 and with -noonion +- Test passing unknown -onlynet """ import socket @@ -349,6 +350,11 @@ class ProxyTest(BitcoinTestFramework): self.nodes[1].extra_args = ["-onlynet=onion", arg] self.nodes[1].assert_start_raises_init_error(expected_msg=msg) + self.log.info("Test passing unknown network to -onlynet raises expected init error") + self.nodes[1].extra_args = ["-onlynet=abc"] + msg = "Error: Unknown network specified in -onlynet: 'abc'" + self.nodes[1].assert_start_raises_init_error(expected_msg=msg) + if __name__ == '__main__': ProxyTest().main()