Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_framework.py
Show First 20 Lines • Show All 548 Lines • ▼ Show 20 Lines | def skip_if_no_bitcoind_zmq(self): | ||||
if not self.is_zmq_compiled(): | if not self.is_zmq_compiled(): | ||||
raise SkipTest("bitcoind has not been built with zmq enabled.") | raise SkipTest("bitcoind has not been built with zmq enabled.") | ||||
def skip_if_no_wallet(self): | def skip_if_no_wallet(self): | ||||
"""Skip the running test if wallet has not been compiled.""" | """Skip the running test if wallet has not been compiled.""" | ||||
if not self.is_wallet_compiled(): | if not self.is_wallet_compiled(): | ||||
raise SkipTest("wallet has not been compiled.") | raise SkipTest("wallet has not been compiled.") | ||||
def skip_if_no_wallet_tool(self): | |||||
"""Skip the running test if bitcoin-wallet has not been compiled.""" | |||||
if not self.is_wallet_tool_compiled(): | |||||
raise SkipTest("bitcoin-wallet has not been compiled") | |||||
def skip_if_no_cli(self): | def skip_if_no_cli(self): | ||||
"""Skip the running test if bitcoin-cli has not been compiled.""" | """Skip the running test if bitcoin-cli has not been compiled.""" | ||||
if not self.is_cli_compiled(): | if not self.is_cli_compiled(): | ||||
raise SkipTest("bitcoin-cli has not been compiled.") | raise SkipTest("bitcoin-cli has not been compiled.") | ||||
def is_cli_compiled(self): | def is_cli_compiled(self): | ||||
"""Checks whether bitcoin-cli was compiled.""" | """Checks whether bitcoin-cli was compiled.""" | ||||
config = configparser.ConfigParser() | config = configparser.ConfigParser() | ||||
config.read_file(open(self.options.configfile, encoding='utf-8')) | config.read_file(open(self.options.configfile, encoding='utf-8')) | ||||
return config["components"].getboolean("ENABLE_CLI") | return config["components"].getboolean("ENABLE_CLI") | ||||
def is_wallet_compiled(self): | def is_wallet_compiled(self): | ||||
"""Checks whether the wallet module was compiled.""" | """Checks whether the wallet module was compiled.""" | ||||
config = configparser.ConfigParser() | config = configparser.ConfigParser() | ||||
config.read_file(open(self.options.configfile, encoding='utf-8')) | config.read_file(open(self.options.configfile, encoding='utf-8')) | ||||
return config["components"].getboolean("ENABLE_WALLET") | return config["components"].getboolean("ENABLE_WALLET") | ||||
def is_wallet_tool_compiled(self): | |||||
"""Checks whether bitcoin-wallet was compiled.""" | |||||
return self.config["components"].getboolean("ENABLE_WALLET_TOOL") | |||||
def is_zmq_compiled(self): | def is_zmq_compiled(self): | ||||
"""Checks whether the zmq module was compiled.""" | """Checks whether the zmq module was compiled.""" | ||||
config = configparser.ConfigParser() | config = configparser.ConfigParser() | ||||
config.read_file(open(self.options.configfile, encoding='utf-8')) | config.read_file(open(self.options.configfile, encoding='utf-8')) | ||||
return config["components"].getboolean("ENABLE_ZMQ") | return config["components"].getboolean("ENABLE_ZMQ") |