test: add is_bitcoin_util_compiled helper

This commit is contained in:
Sebastian Falbesoner
2022-04-11 21:39:13 +02:00
parent dde33eca63
commit 449b96ed97
2 changed files with 10 additions and 0 deletions

View File

@ -886,6 +886,11 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
if not self.is_wallet_tool_compiled():
raise SkipTest("bitcoin-wallet has not been compiled")
def skip_if_no_bitcoin_util(self):
"""Skip the running test if bitcoin-util has not been compiled."""
if not self.is_bitcoin_util_compiled():
raise SkipTest("bitcoin-util has not been compiled")
def skip_if_no_cli(self):
"""Skip the running test if bitcoin-cli has not been compiled."""
if not self.is_cli_compiled():
@ -933,6 +938,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
"""Checks whether bitcoin-wallet was compiled."""
return self.config["components"].getboolean("ENABLE_WALLET_TOOL")
def is_bitcoin_util_compiled(self):
"""Checks whether bitcoin-util was compiled."""
return self.config["components"].getboolean("ENABLE_BITCOIN_UTIL")
def is_zmq_compiled(self):
"""Checks whether the zmq module was compiled."""
return self.config["components"].getboolean("ENABLE_ZMQ")