From b2fc57194392eef601287f77147c679acb2f63c9 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 18 Mar 2019 11:53:47 +0000 Subject: functional_tests: support several daemons/wallets --- tests/functional_tests/test_framework/daemon.py | 4 ++-- tests/functional_tests/test_framework/wallet.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/functional_tests/test_framework') diff --git a/tests/functional_tests/test_framework/daemon.py b/tests/functional_tests/test_framework/daemon.py index ee1fcc0fc..0d0eda7dc 100644 --- a/tests/functional_tests/test_framework/daemon.py +++ b/tests/functional_tests/test_framework/daemon.py @@ -32,8 +32,8 @@ from .rpc import JSONRPC class Daemon(object): - def __init__(self, protocol='http', host='127.0.0.1', port=18081): - self.rpc = JSONRPC('{protocol}://{host}:{port}'.format(protocol=protocol, host=host, port=port)) + def __init__(self, protocol='http', host='127.0.0.1', port=0, idx=0): + self.rpc = JSONRPC('{protocol}://{host}:{port}'.format(protocol=protocol, host=host, port=port if port else 18180+idx)) def getblocktemplate(self, address): getblocktemplate = { diff --git a/tests/functional_tests/test_framework/wallet.py b/tests/functional_tests/test_framework/wallet.py index e4f352e1d..4f2997cc4 100644 --- a/tests/functional_tests/test_framework/wallet.py +++ b/tests/functional_tests/test_framework/wallet.py @@ -32,8 +32,8 @@ from .rpc import JSONRPC class Wallet(object): - def __init__(self, protocol='http', host='127.0.0.1', port=18083): - self.rpc = JSONRPC('{protocol}://{host}:{port}'.format(protocol=protocol, host=host, port=port)) + def __init__(self, protocol='http', host='127.0.0.1', port=0, idx=0): + self.rpc = JSONRPC('{protocol}://{host}:{port}'.format(protocol=protocol, host=host, port=port if port else 18090+idx)) def make_uniform_destinations(self, address, transfer_amount, transfer_number_of_destinations=1): destinations = [] -- cgit v1.2.3