From d576ab0cf782987149d88ecd03c89d51b875e374 Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Sat, 3 Oct 2020 12:41:25 +0200 Subject: [PATCH] [enh] #88: membership: Rework fields names (2) --- silkaj/membership.py | 10 ++++++---- tests/test_membership.py | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/silkaj/membership.py b/silkaj/membership.py index c4fcf34d..2f7e1eee 100644 --- a/silkaj/membership.py +++ b/silkaj/membership.py @@ -123,7 +123,7 @@ async def display_confirmation_table(identity_uid, pubkey, identity_timestamp): table = list() if membership_expires: expires = pendulum.now().add(seconds=membership_expires).diff_for_humans() - table.append(["Current membership will expire", expires]) + table.append(["Expiration date of current membership", expires]) if pending_memberships: line = [ @@ -138,7 +138,7 @@ async def display_confirmation_table(identity_uid, pubkey, identity_timestamp): table.append(["User Identifier (UID)", identity_uid]) table.append(["Public Key", pubkey]) - table.append(["Block Identity", identity_timestamp]) + table.append(["Block Identity", str(identity_timestamp)[:45] + "…"]) block = await client(bma.blockchain.block, identity_timestamp.number) table.append( @@ -149,12 +149,14 @@ async def display_confirmation_table(identity_uid, pubkey, identity_timestamp): membership_validity = ( pendulum.now().add(seconds=params["msValidity"]).diff_for_humans() ) - table.append(["This membership expiration", membership_validity]) + table.append(["Expiration date of new membership", membership_validity]) membership_mempool = ( pendulum.now().add(seconds=params["msPeriod"]).diff_for_humans() ) - table.append(["This membership expiration from the mempool", membership_mempool]) + table.append( + ["Expiration date of new membership from the mempool", membership_mempool] + ) click.echo(tabulate(table, tablefmt="fancy_grid")) diff --git a/tests/test_membership.py b/tests/test_membership.py index 24789b66..52730310 100644 --- a/tests/test_membership.py +++ b/tests/test_membership.py @@ -201,7 +201,7 @@ async def test_display_confirmation_table( table = list() if membership_expires: expires = pendulum.now().add(seconds=membership_expires).diff_for_humans() - table.append(["Current membership will expire", expires]) + table.append(["Expiration date of current membership", expires]) if pending_memberships: line = [ @@ -215,7 +215,7 @@ async def test_display_confirmation_table( table.append(["User Identifier (UID)", identity_uid]) table.append(["Public Key", pubkey]) - table.append(["Block Identity", identity_timestamp]) + table.append(["Block Identity", str(identity_timestamp)[:45] + "…"]) block = await client(bma.blockchain.block, identity_timestamp.number) table.append( @@ -226,12 +226,14 @@ async def test_display_confirmation_table( membership_validity = ( pendulum.now().add(seconds=params["msValidity"]).diff_for_humans() ) - table.append(["This membership expiration", membership_validity]) + table.append(["Expiration date of new membership", membership_validity]) membership_mempool = ( pendulum.now().add(seconds=params["msPeriod"]).diff_for_humans() ) - table.append(["This membership expiration from the mempool", membership_mempool]) + table.append( + ["Expiration date of new membership from the mempool", membership_mempool] + ) expected = tabulate(table, tablefmt="fancy_grid") + "\n" -- GitLab