diff --git a/silkaj/membership.py b/silkaj/membership.py index 6862199660b2e9aaec942b2c2df105a31ff87122..27db510aacc7293af471c49495a7927288fe6aa7 100644 --- a/silkaj/membership.py +++ b/silkaj/membership.py @@ -21,7 +21,6 @@ import pendulum from duniterpy.api import bma from duniterpy.documents import BlockID, Membership, get_block_id from duniterpy.key import SigningKey -from tabulate import tabulate from silkaj import auth, tui, wot from silkaj.blockchain_tools import get_blockchain_parameters, get_head_block @@ -90,7 +89,7 @@ def display_confirmation_table( Check whether there is pending memberships already in the mempool Display their expiration date - Actually, it works sending a membership document even if the time + Actually, sending a membership document works even if the time between two renewals is not awaited as for the certification """ @@ -152,7 +151,9 @@ def display_confirmation_table( ] ) - click.echo(tabulate(table, tablefmt="fancy_grid")) + display_table = tui.Table() + display_table.fill_rows(table) + click.echo(display_table.draw()) def generate_membership_document( diff --git a/tests/test_membership.py b/tests/test_membership.py index 877f66d102efcfbb66919885c8efee71139d306e..7cb0df38a61a4f6d7fedbf3b7c239ef32eebf200 100644 --- a/tests/test_membership.py +++ b/tests/test_membership.py @@ -21,7 +21,6 @@ from click.testing import CliRunner from duniterpy.api import bma from duniterpy.documents import Membership, get_block_id from duniterpy.key import SigningKey -from tabulate import tabulate from patched.blockchain_tools import ( currency, @@ -34,12 +33,11 @@ from patched.wot import ( patched_wot_requirements_no_pending, patched_wot_requirements_one_pending, ) -from silkaj import auth, blockchain_tools, membership, wot +from silkaj import auth, blockchain_tools, membership, tui, wot from silkaj.blockchain_tools import get_blockchain_parameters from silkaj.cli import cli from silkaj.constants import DATE from silkaj.network_tools import client_instance -from silkaj.tui import gen_pubkey_checksum # Values and patches PUBKEY = "EA7Dsw39ShZg4SpURsrgMaMqrweJPUFPYHwZA8e92e3D" @@ -167,7 +165,7 @@ def test_display_confirmation_table(patched_wot_requirements, monkeypatch, capsy ) table.append(["User Identifier (UID)", identity_uid]) - table.append(["Public Key", gen_pubkey_checksum(PUBKEY)]) + table.append(["Public Key", tui.gen_pubkey_checksum(PUBKEY)]) table.append(["Block Identity", str(identity_block_id)[:45] + "…"]) @@ -194,7 +192,9 @@ def test_display_confirmation_table(patched_wot_requirements, monkeypatch, capsy ] ) - expected = tabulate(table, tablefmt="fancy_grid") + "\n" + display_table = tui.Table() + display_table.fill_rows(table) + expected = display_table.draw() + "\n" membership.display_confirmation_table(identity_uid, PUBKEY, identity_block_id) captured = capsys.readouterr()