mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 11:13:23 -03:00
[refactor] Rename test file to allow any getpeerinfo deprecations.
Simple rename/restructure to allow for upcoming test additions.
This commit is contained in:
parent
395acfa83a
commit
df091b9b50
2 changed files with 7 additions and 5 deletions
|
@ -2,23 +2,25 @@
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test deprecation of getpeerinfo RPC banscore field."""
|
"""Test deprecation of getpeerinfo RPC fields."""
|
||||||
|
|
||||||
from test_framework.test_framework import BitcoinTestFramework
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
|
|
||||||
|
|
||||||
class GetpeerinfoBanscoreDeprecationTest(BitcoinTestFramework):
|
class GetpeerinfoDeprecationTest(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.extra_args = [[], ["-deprecatedrpc=banscore"]]
|
self.extra_args = [[], ["-deprecatedrpc=banscore"]]
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
|
self.test_banscore_deprecation()
|
||||||
|
|
||||||
|
def test_banscore_deprecation(self):
|
||||||
self.log.info("Test getpeerinfo by default no longer returns a banscore field")
|
self.log.info("Test getpeerinfo by default no longer returns a banscore field")
|
||||||
assert "banscore" not in self.nodes[0].getpeerinfo()[0].keys()
|
assert "banscore" not in self.nodes[0].getpeerinfo()[0].keys()
|
||||||
|
|
||||||
self.log.info("Test getpeerinfo returns banscore with -deprecatedrpc=banscore")
|
self.log.info("Test getpeerinfo returns banscore with -deprecatedrpc=banscore")
|
||||||
assert "banscore" in self.nodes[1].getpeerinfo()[0].keys()
|
assert "banscore" in self.nodes[1].getpeerinfo()[0].keys()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
GetpeerinfoBanscoreDeprecationTest().main()
|
GetpeerinfoDeprecationTest().main()
|
|
@ -251,7 +251,7 @@ BASE_SCRIPTS = [
|
||||||
'feature_config_args.py',
|
'feature_config_args.py',
|
||||||
'feature_settings.py',
|
'feature_settings.py',
|
||||||
'rpc_getdescriptorinfo.py',
|
'rpc_getdescriptorinfo.py',
|
||||||
'rpc_getpeerinfo_banscore_deprecation.py',
|
'rpc_getpeerinfo_deprecation.py',
|
||||||
'rpc_help.py',
|
'rpc_help.py',
|
||||||
'feature_help.py',
|
'feature_help.py',
|
||||||
'feature_shutdown.py',
|
'feature_shutdown.py',
|
||||||
|
|
Loading…
Add table
Reference in a new issue