Changeset View
Changeset View
Standalone View
Standalone View
test/functional/tool_wallet.py
Show All 19 Lines | def skip_test_if_missing_module(self): | ||||
self.skip_if_no_wallet() | self.skip_if_no_wallet() | ||||
self.skip_if_no_wallet_tool() | self.skip_if_no_wallet_tool() | ||||
def bitcoin_wallet_process(self, *args): | def bitcoin_wallet_process(self, *args): | ||||
binary = self.config["environment"]["BUILDDIR"] + \ | binary = self.config["environment"]["BUILDDIR"] + \ | ||||
'/src/bitcoin-wallet' + self.config["environment"]["EXEEXT"] | '/src/bitcoin-wallet' + self.config["environment"]["EXEEXT"] | ||||
args = ['-datadir={}'.format(self.nodes[0].datadir), | args = ['-datadir={}'.format(self.nodes[0].datadir), | ||||
'-regtest'] + list(args) | '-regtest'] + list(args) | ||||
return subprocess.Popen([binary] + args, stdin=subprocess.PIPE, | |||||
command_line = [binary] + args | |||||
if self.config["environment"]["EMULATOR"]: | |||||
command_line = [ | |||||
self.config["environment"]["EMULATOR"]] + command_line | |||||
return subprocess.Popen(command_line, stdin=subprocess.PIPE, | |||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) | stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) | ||||
def assert_raises_tool_error(self, error, *args): | def assert_raises_tool_error(self, error, *args): | ||||
p = self.bitcoin_wallet_process(*args) | p = self.bitcoin_wallet_process(*args) | ||||
stdout, stderr = p.communicate() | stdout, stderr = p.communicate() | ||||
assert_equal(p.poll(), 1) | assert_equal(p.poll(), 1) | ||||
assert_equal(stdout, '') | assert_equal(stdout, '') | ||||
assert_equal(stderr.strip(), error) | assert_equal(stderr.strip(), error) | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |