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
7647c72f
Commit
7647c72f
authored
1 year ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
Simplify revocation tests (
#435
)
parent
e239f0fc
No related branches found
Branches containing commit
No related tags found
1 merge request
!248
Revocation: remove dry-run and display options from save and verify cmds, drop default revocation file path (#435)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/unit/wot/test_revocation.py
+22
-30
22 additions, 30 deletions
tests/unit/wot/test_revocation.py
with
22 additions
and
30 deletions
tests/unit/wot/test_revocation.py
+
22
−
30
View file @
7647c72f
...
...
@@ -178,7 +178,7 @@ def test_revocation_cli_dry_run(subcommand, expected_warn, monkeypatch):
with
runner
.
isolated_filesystem
():
Path
(
file
).
write_text
(
REV_DOC
.
signed_raw
(),
encoding
=
"
utf-8
"
)
result
=
runner
.
invoke
(
cli
,
args
=
command
)
assert
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
in
result
.
output
assert
idty1
.
pubkey
in
result
.
output
assert
"
Version: 10
"
in
result
.
output
if
expected_warn
:
...
...
@@ -187,6 +187,12 @@ def test_revocation_cli_dry_run(subcommand, expected_warn, monkeypatch):
assert
warning
not
in
result
.
output
CREATE_STRINGS
=
[
idty1
.
pubkey
,
"
Do you want to save the revocation document for this identity?
"
,
]
# test cli create
@pytest.mark.parametrize
(
(
"
file
"
,
"
user_input
"
,
"
expected
"
),
...
...
@@ -194,41 +200,27 @@ def test_revocation_cli_dry_run(subcommand, expected_warn, monkeypatch):
(
None
,
"
yes
\n
"
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
"
Do you want to save the revocation document for this identity?
"
,
],
CREATE_STRINGS
,
),
(
None
,
None
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
],
CREATE_STRINGS
,
),
(
Path
(
"
test_doc
"
),
"
yes
\n
"
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
"
Do you want to save the revocation document for this identity?
"
,
],
CREATE_STRINGS
,
),
(
Path
(
"
test_doc
"
),
None
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
],
CREATE_STRINGS
,
),
(
None
,
"
no
\n
"
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
"
Do you want to save the revocation document for this identity?
"
,
"
Ok, goodbye!
"
,
],
[
*
CREATE_STRINGS
,
"
Ok, goodbye!
"
],
),
],
)
...
...
@@ -713,7 +705,7 @@ def test_revocation_cli_publish_send_errors(
"
yes
\n
"
,
REV_DOC
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
idty1
.
pubkey
,
"
Do you confirm sending this revocation document immediately?
"
,
],
),
...
...
@@ -723,7 +715,7 @@ def test_revocation_cli_publish_send_errors(
"
yes
\n
"
,
REV_DOC
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
idty1
.
pubkey
,
"
Do you confirm sending this revocation document immediately?
"
,
"
Version: 10
"
,
],
...
...
@@ -735,7 +727,7 @@ def test_revocation_cli_publish_send_errors(
REV_DOC
,
[
"
WARNING: the document will only be displayed and will not be sent.
"
,
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
idty1
.
pubkey
,
"
Version: 10
"
,
],
),
...
...
@@ -745,7 +737,7 @@ def test_revocation_cli_publish_send_errors(
"
no
\n
"
,
REV_DOC
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
idty1
.
pubkey
,
"
Do you confirm sending this revocation document immediately?
"
,
],
),
...
...
@@ -755,7 +747,7 @@ def test_revocation_cli_publish_send_errors(
"
no
\n
"
,
REV_DOC
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
idty1
.
pubkey
,
"
Do you confirm sending this revocation document immediately?
"
,
"
Version: 10
"
,
],
...
...
@@ -799,7 +791,7 @@ def test_revocation_cli_revoke(
"
yes
\n
"
,
REV_DOC
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
idty1
.
pubkey
,
"
Do you confirm sending this revocation document immediately?
"
,
"
Error while publishing revocation
"
,
],
...
...
@@ -809,7 +801,7 @@ def test_revocation_cli_revoke(
"
yes
\n
"
,
REV_DOC
,
[
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
idty1
.
pubkey
,
"
Do you confirm sending this revocation document immediately?
"
,
"
Version: 10
"
,
"
Error while publishing revocation
"
,
...
...
@@ -838,7 +830,7 @@ def test_revocation_cli_revoke_errors(display, user_input, doc, expected, monkey
def
test_create_revocation_doc
(
idty
,
lookup
):
test
=
revocation
.
create_revocation_doc
(
lookup
[
"
results
"
][
0
][
"
uids
"
][
0
],
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
idty1
.
pubkey
,
"
g1-test
"
,
)
expected
=
Revocation
(
...
...
@@ -857,13 +849,13 @@ def test_create_revocation_doc(idty, lookup):
Path
(
"
./test_doc.txt
"
),
REV_DOC
,
REV_2
,
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
idty1
.
pubkey
,
),
(
Path
(
"
revocation
"
),
REV_DOC
,
REV_2
,
"
6upqFiJ66WV6N3bPc8x8y7rXT3syqKRmwnVyunCtEj7o
"
,
idty1
.
pubkey
,
),
],
)
...
...
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