From f08ffe7bf5070fc42577e0a2e0cdcc601827c3df Mon Sep 17 00:00:00 2001 From: EggPool Date: Mon, 19 Oct 2020 14:53:31 +0200 Subject: [PATCH] Retrofit tests and requirements to last version --- tests/requirements.txt | 2 +- tests/test_node.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 1b7d29d..abd945c 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,3 +1,3 @@ bismuthclient -bismuthcore +bismuthcore>=0.0.18 pytest diff --git a/tests/test_node.py b/tests/test_node.py index 2e71e97..b250b42 100644 --- a/tests/test_node.py +++ b/tests/test_node.py @@ -52,7 +52,9 @@ def test_api_config(myserver, verbose=False): if verbose: print(f"api_getconfig returns {data}") assert data['regnet'] is True - assert data['port'] == "3030" + # Do not enforce type. Old node sent string, this is an int. V2 returns an int (config is typed). + # Voluntary break formal compatibility in favor of correct typing. + assert int(data['port']) == 3030 def test_api_getaddresssince(myserver, verbose=False): @@ -110,6 +112,8 @@ def test_pubkey_address(myserver, verbose=False): if verbose: print(f"blocklastjson returns {data}") pubkey = b64decode(data['public_key']).decode('utf-8') + if verbose: + print("Pubkey", pubkey, type(pubkey)) address = hashlib.sha224(pubkey.encode("utf-8")).hexdigest() assert address == client.address