Merge #10859: RPC: gettxout: Slightly improve doc and tests
[bitcoinplatinum.git] / test / functional / uptime.py
blobb20d6f5cb62bfe755905bf89d06720fd67390881
1 #!/usr/bin/env python3
2 # Copyright (c) 2017 The Bitcoin Core developers
3 # Distributed under the MIT software license, see the accompanying
4 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 """Test the RPC call related to the uptime command.
7 Test corresponds to code in rpc/server.cpp.
8 """
10 import time
12 from test_framework.test_framework import BitcoinTestFramework
15 class UptimeTest(BitcoinTestFramework):
16 def __init__(self):
17 super().__init__()
19 self.num_nodes = 1
20 self.setup_clean_chain = True
22 def run_test(self):
23 self._test_uptime()
25 def _test_uptime(self):
26 wait_time = 10
27 self.nodes[0].setmocktime(int(time.time() + wait_time))
28 assert(self.nodes[0].uptime() >= wait_time)
31 if __name__ == '__main__':
32 UptimeTest().main()