Browse Source

pytest: Have bitcoind remember its config file

There were a few places we were rebuilding the config path by appending
`bitcoin.conf` to the bitcoin directory. So now we just remember it and
reference it instead.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
travis-debug
Christian Decker 6 years ago
committed by Rusty Russell
parent
commit
25c830a533
  1. 3
      tests/btcproxy.py
  2. 6
      tests/utils.py

3
tests/btcproxy.py

@ -34,8 +34,7 @@ class BitcoinRpcProxy(object):
self.request_count = 0
def _handle_request(self, r):
conf_file = os.path.join(self.bitcoind.bitcoin_dir, 'bitcoin.conf')
brpc = BitcoinProxy(btc_conf_file=conf_file)
brpc = BitcoinProxy(btc_conf_file=self.bitcoind.conf_file)
method = r['method']
# If we have set a mock for this method reply with that instead of

6
tests/utils.py

@ -305,9 +305,9 @@ class BitcoinD(TailableProc):
# For after 0.16.1 (eg. 3f398d7a17f136cd4a67998406ca41a124ae2966), this
# needs its own [regtest] section.
BITCOIND_REGTEST = {'rpcport': rpcport}
btc_conf_file = os.path.join(bitcoin_dir, 'bitcoin.conf')
write_config(btc_conf_file, BITCOIND_CONFIG, BITCOIND_REGTEST)
self.rpc = SimpleBitcoinProxy(btc_conf_file=btc_conf_file)
self.conf_file = os.path.join(bitcoin_dir, 'bitcoin.conf')
write_config(self.conf_file, BITCOIND_CONFIG, BITCOIND_REGTEST)
self.rpc = SimpleBitcoinProxy(btc_conf_file=self.conf_file)
self.proxies = []
def start(self):

Loading…
Cancel
Save