Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/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 the getgeneralinfo RPC.""" | ||
|
||
from test_framework.test_framework import BitcoinTestFramework | ||
from test_framework.util import assert_equal, try_rpc | ||
|
||
class GetGeneralInfoTest(BitcoinTestFramework): | ||
def set_test_params(self): | ||
self.setup_clean_chain = False | ||
self.num_nodes = 1 | ||
|
||
def skip_test_if_missing_module(self): | ||
self.skip_if_no_cli() | ||
|
||
def run_test(self): | ||
"""Test getgeneralinfo.""" | ||
"""check if 'getgeneralinfo' is callable""" | ||
try_rpc(None, None, self.nodes[0].getgeneralinfo, None, None) | ||
"""check if 'getgeneralinfo' is idempotent (multiple requests return same data)""" | ||
json1 = self.nodes[0].getgeneralinfo() | ||
json2 = self.nodes[0].getgeneralinfo() | ||
assert_equal(json1, json2) | ||
|
||
if __name__ == '__main__': | ||
GetGeneralInfoTest().main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters