mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
0a255fec40
a0b604c166 [tests] skip rpc_zmq functional test when python3 zmq lib is not present (James O'Beirne) Pull request description: As noted in https://github.com/bitcoin/bitcoin/pull/13570/files#r201715904, the `rpc_zmq` functional test should be skipped when the `zmq` python3 package is not installed. This is breaking https://bitcoinperf.com benchmarks at the moment. Tree-SHA512: ab519ae717f4b7a282640cf0389651723fdc108990aeb9852e8b9e96d61fa1ded2461717ae31558b37ff8401a5b1ccc41f4e858e402b8c3d98563d962599767a
37 lines
1.1 KiB
Python
Executable File
37 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
# Copyright (c) 2018 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 for the ZMQ RPC methods."""
|
|
|
|
from test_framework.test_framework import (
|
|
BitcoinTestFramework, skip_if_no_py3_zmq, skip_if_no_bitcoind_zmq)
|
|
from test_framework.util import assert_equal
|
|
|
|
|
|
class RPCZMQTest(BitcoinTestFramework):
|
|
|
|
address = "tcp://127.0.0.1:28332"
|
|
|
|
def set_test_params(self):
|
|
self.num_nodes = 1
|
|
self.setup_clean_chain = True
|
|
|
|
def run_test(self):
|
|
skip_if_no_py3_zmq()
|
|
skip_if_no_bitcoind_zmq(self)
|
|
self._test_getzmqnotifications()
|
|
|
|
def _test_getzmqnotifications(self):
|
|
self.restart_node(0, extra_args=[])
|
|
assert_equal(self.nodes[0].getzmqnotifications(), [])
|
|
|
|
self.restart_node(0, extra_args=["-zmqpubhashtx=%s" % self.address])
|
|
assert_equal(self.nodes[0].getzmqnotifications(), [
|
|
{"type": "pubhashtx", "address": self.address},
|
|
])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
RPCZMQTest().main()
|