[refactor] Rename test file to allow any getpeerinfo deprecations.

Simple rename/restructure to allow for upcoming test additions.
This commit is contained in:
Amiti Uttarwar
2020-08-12 15:50:19 -07:00
parent 395acfa83a
commit df091b9b50
2 changed files with 7 additions and 5 deletions

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of getpeerinfo RPC fields."""
from test_framework.test_framework import BitcoinTestFramework
class GetpeerinfoDeprecationTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.extra_args = [[], ["-deprecatedrpc=banscore"]]
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")
assert "banscore" not in self.nodes[0].getpeerinfo()[0].keys()
self.log.info("Test getpeerinfo returns banscore with -deprecatedrpc=banscore")
assert "banscore" in self.nodes[1].getpeerinfo()[0].keys()
if __name__ == "__main__":
GetpeerinfoDeprecationTest().main()