Merge #10845: Remove unreachable code
[bitcoinplatinum.git] / test / functional / uptime.py
blob78236b239374a794703e9635666828586b0a7045
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 set_test_params(self):
17 self.num_nodes = 1
18 self.setup_clean_chain = True
20 def run_test(self):
21 self._test_uptime()
23 def _test_uptime(self):
24 wait_time = 10
25 self.nodes[0].setmocktime(int(time.time() + wait_time))
26 assert(self.nodes[0].uptime() >= wait_time)
29 if __name__ == '__main__':
30 UptimeTest().main()