Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_node.py
Show All 11 Lines | |||||
import json | import json | ||||
import logging | import logging | ||||
import os | import os | ||||
import re | import re | ||||
import subprocess | import subprocess | ||||
import sys | import sys | ||||
import tempfile | import tempfile | ||||
import time | import time | ||||
import urllib.parse | |||||
from .authproxy import JSONRPCException | from .authproxy import JSONRPCException | ||||
from .messages import COIN, CTransaction, FromHex | from .messages import COIN, CTransaction, FromHex | ||||
from .util import ( | from .util import ( | ||||
append_config, | append_config, | ||||
delete_cookie_file, | delete_cookie_file, | ||||
get_rpc_proxy, | get_rpc_proxy, | ||||
p2p_port, | p2p_port, | ||||
▲ Show 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | class TestNode(): | ||||
def get_wallet_rpc(self, wallet_name): | def get_wallet_rpc(self, wallet_name): | ||||
if self.use_cli: | if self.use_cli: | ||||
return self.cli("-rpcwallet={}".format(wallet_name)) | return self.cli("-rpcwallet={}".format(wallet_name)) | ||||
else: | else: | ||||
assert self.rpc is not None, self._node_msg( | assert self.rpc is not None, self._node_msg( | ||||
"Error: RPC not initialized") | "Error: RPC not initialized") | ||||
assert self.rpc_connected, self._node_msg( | assert self.rpc_connected, self._node_msg( | ||||
"Error: RPC not connected") | "Error: RPC not connected") | ||||
wallet_path = "wallet/{}".format(wallet_name) | wallet_path = "wallet/{}".format(urllib.parse.quote(wallet_name)) | ||||
return self.rpc / wallet_path | return self.rpc / wallet_path | ||||
def stop_node(self, expected_stderr='', wait=0): | def stop_node(self, expected_stderr='', wait=0): | ||||
"""Stop the node.""" | """Stop the node.""" | ||||
if not self.running: | if not self.running: | ||||
return | return | ||||
self.log.debug("Stopping node") | self.log.debug("Stopping node") | ||||
try: | try: | ||||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |