Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
b529481b
Commit
b529481b
authored
2 years ago
by
matograine
Committed by
Moul
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[enh] membership: Migrate from tabulate to texttable (
#203
)
update related tests
parent
c97dfe3f
No related branches found
No related tags found
1 merge request
!199
#203: Harmonize tables style using Texttable
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
silkaj/membership.py
+4
-3
4 additions, 3 deletions
silkaj/membership.py
tests/test_membership.py
+5
-5
5 additions, 5 deletions
tests/test_membership.py
with
9 additions
and
8 deletions
silkaj/membership.py
+
4
−
3
View file @
b529481b
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
tests/test_membership.py
+
5
−
5
View file @
b529481b
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment