mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Prevent TestNodeCLI.args mixups
Change TestNodeCLI.__call__() to return a new instance instead of modifying the existing instance. This way, it's possible to create different cli objects that have their own options (for example -rpcwallet options to connect to different wallets), and options set for a single call (`node.cli(options).method(args)`) will no longer leak into future calls.
This commit is contained in:
parent
fcfb952bca
commit
ca9085afc5
@ -203,9 +203,10 @@ class TestNodeCLI():
|
|||||||
|
|
||||||
def __call__(self, *args, input=None):
|
def __call__(self, *args, input=None):
|
||||||
# TestNodeCLI is callable with bitcoin-cli command-line args
|
# TestNodeCLI is callable with bitcoin-cli command-line args
|
||||||
self.args = [str(arg) for arg in args]
|
cli = TestNodeCLI(self.binary, self.datadir)
|
||||||
self.input = input
|
cli.args = [str(arg) for arg in args]
|
||||||
return self
|
cli.input = input
|
||||||
|
return cli
|
||||||
|
|
||||||
def __getattr__(self, command):
|
def __getattr__(self, command):
|
||||||
def dispatcher(*args, **kwargs):
|
def dispatcher(*args, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user