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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
d576ab0c
Commit
d576ab0c
authored
4 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[enh]
#88
: membership: Rework fields names (2)
parent
863383c8
No related branches found
No related tags found
2 merge requests
!146
Merge dev into master branch to complete v0.8.0 development cycle
,
!144
Rework tables fields
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
silkaj/membership.py
+6
-4
6 additions, 4 deletions
silkaj/membership.py
tests/test_membership.py
+6
-4
6 additions, 4 deletions
tests/test_membership.py
with
12 additions
and
8 deletions
silkaj/membership.py
+
6
−
4
View file @
d576ab0c
...
...
@@ -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
([
"
C
urrent membership
will expire
"
,
expires
])
table
.
append
([
"
Expiration date of c
urrent 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
"
))
...
...
This diff is collapsed.
Click to expand it.
tests/test_membership.py
+
6
−
4
View file @
d576ab0c
...
...
@@ -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
([
"
C
urrent membership
will expire
"
,
expires
])
table
.
append
([
"
Expiration date of c
urrent 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
"
...
...
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