QA: Avoid re-reading config.ini unnecessarily

BitcoinTestFramework.main already loads and stores config.ini on the object itself; just access that instead of re-reading the file to check for features
This commit is contained in:
Luke Dashjr 2019-04-25 09:12:36 +00:00
parent 37f236acc6
commit a014373d81

View file

@ -553,21 +553,12 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
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() return self.config["components"].getboolean("ENABLE_CLI")
config.read_file(open(self.options.configfile))
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() return self.config["components"].getboolean("ENABLE_WALLET")
config.read_file(open(self.options.configfile))
return config["components"].getboolean("ENABLE_WALLET")
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() return self.config["components"].getboolean("ENABLE_ZMQ")
config.read_file(open(self.options.configfile))
return config["components"].getboolean("ENABLE_ZMQ")