diff --git a/sauron/tests/test_sauron_esplora_bitcoin.py b/sauron/tests/test_sauron_esplora_bitcoin.py index 88e474095..410b88e0b 100644 --- a/sauron/tests/test_sauron_esplora_bitcoin.py +++ b/sauron/tests/test_sauron_esplora_bitcoin.py @@ -16,8 +16,7 @@ def __init__(self, *args, **kwargs): pyln.testing.utils.TEST_NETWORK = "bitcoin" utils.LightningNode.__init__(self, *args, **kwargs) lightning_dir = args[1] - - self.daemon = LightningD(lightning_dir, None) # noqa: F405 + self.daemon = LightningD(lightning_dir, None, port=self.daemon.port) # noqa: F405 options = { "disable-plugin": "bcli", "network": "bitcoin", @@ -111,6 +110,7 @@ def test_rpc_estimatefees(node_factory): """ Test estimatefees """ + ln_node = node_factory.get_node() # Sample response @@ -133,6 +133,8 @@ def test_rpc_estimatefees(node_factory): # } response = ln_node.rpc.call("estimatefees") + + expected_response_keys = [ "opening", "mutual_close", diff --git a/sauron/tests/test_sauron_esplora_signet.py b/sauron/tests/test_sauron_esplora_signet.py index 8ab376178..33e894be7 100644 --- a/sauron/tests/test_sauron_esplora_signet.py +++ b/sauron/tests/test_sauron_esplora_signet.py @@ -16,8 +16,7 @@ def __init__(self, *args, **kwargs): pyln.testing.utils.TEST_NETWORK = "signet" utils.LightningNode.__init__(self, *args, **kwargs) lightning_dir = args[1] - - self.daemon = LightningD(lightning_dir, None) # noqa: F405 + self.daemon = LightningD(lightning_dir, None, port=self.daemon.port) # noqa: F405 options = { "disable-plugin": "bcli", "network": "signet", @@ -74,16 +73,15 @@ def test_rpc_sendrawtransaction_invalid(node_factory): """ ln_node = node_factory.get_node() - expected_response = { - "errmsg": 'sendrawtransaction RPC error: {"code":-22,"message":"TX decode failed. Make sure the tx has at least one input."}', - "success": False, - } + expected_error_substring = "RPC error" + response = ln_node.rpc.call( "sendrawtransaction", {"tx": "invalid-raw-tx"}, ) - assert response == expected_response + assert expected_error_substring in response.get("errmsg", ""), "Expected 'RPC error' in errmsg field" + assert response.get("success") is False, "Expected success to be False" def test_rpc_getutxout(node_factory): diff --git a/sauron/tests/test_sauron_esplora_testnet.py b/sauron/tests/test_sauron_esplora_testnet.py index e135967de..0f4da80d7 100644 --- a/sauron/tests/test_sauron_esplora_testnet.py +++ b/sauron/tests/test_sauron_esplora_testnet.py @@ -16,8 +16,7 @@ def __init__(self, *args, **kwargs): pyln.testing.utils.TEST_NETWORK = "testnet" utils.LightningNode.__init__(self, *args, **kwargs) lightning_dir = args[1] - - self.daemon = LightningD(lightning_dir, None) # noqa: F405 + self.daemon = LightningD(lightning_dir, None, port=self.daemon.port) # noqa: F405 options = { "disable-plugin": "bcli", "network": "testnet", @@ -74,16 +73,15 @@ def test_rpc_sendrawtransaction_invalid(node_factory): """ ln_node = node_factory.get_node() - expected_response = { - "errmsg": 'sendrawtransaction RPC error: {"code":-22,"message":"TX decode failed. Make sure the tx has at least one input."}', - "success": False, - } + expected_error_substring = "RPC error" + response = ln_node.rpc.call( "sendrawtransaction", {"tx": "invalid-raw-tx"}, ) - assert response == expected_response + assert expected_error_substring in response.get("errmsg", ""), "Expected 'RPC error' in errmsg field" + assert response.get("success") is False, "Expected success to be False" def test_rpc_getutxout(node_factory): diff --git a/sauron/tests/test_sauron_esplora_tor_proxy.py b/sauron/tests/test_sauron_esplora_tor_proxy.py index 26321cf1e..9c0bd60ff 100644 --- a/sauron/tests/test_sauron_esplora_tor_proxy.py +++ b/sauron/tests/test_sauron_esplora_tor_proxy.py @@ -16,8 +16,7 @@ def __init__(self, *args, **kwargs): pyln.testing.utils.TEST_NETWORK = "bitcoin" utils.LightningNode.__init__(self, *args, **kwargs) lightning_dir = args[1] - - self.daemon = LightningD(lightning_dir, None) # noqa: F405 + self.daemon = LightningD(lightning_dir, None, port=self.daemon.port) # noqa: F405 options = { "disable-plugin": "bcli", "network": "bitcoin", diff --git a/sauron/tests/test_sauron_mempoolspace_signet.py b/sauron/tests/test_sauron_mempoolspace_signet.py index 5b0bcbe04..8904f185f 100644 --- a/sauron/tests/test_sauron_mempoolspace_signet.py +++ b/sauron/tests/test_sauron_mempoolspace_signet.py @@ -16,8 +16,7 @@ def __init__(self, *args, **kwargs): pyln.testing.utils.TEST_NETWORK = "signet" utils.LightningNode.__init__(self, *args, **kwargs) lightning_dir = args[1] - - self.daemon = LightningD(lightning_dir, None) # noqa: F405 + self.daemon = LightningD(lightning_dir, None, port=self.daemon.port) # noqa: F405 options = { "disable-plugin": "bcli", "network": "signet",