Skip to content
Snippets Groups Projects
Commit e239f0fc authored by Moul's avatar Moul
Browse files

revocation verify: Remove dry-run and display options support (#435)

remove duplicate tests after simplification
parent 63f3b205
No related branches found
No related tags found
1 merge request!248Revocation: remove dry-run and display options from save and verify cmds, drop default revocation file path (#435)
......@@ -106,16 +106,8 @@ existing identity.\nOptionnaly takes the document filename.",
@click.pass_context
def verify(ctx: click.Context, file: Path) -> None:
rev_doc = verify_document(file)
if ctx.obj["DRY_RUN"]:
click.echo(rev_doc.signed_raw())
return
idty_table = idty_tools.display_identity(rev_doc.identity)
click.echo(idty_table.draw())
if ctx.obj["DISPLAY_DOCUMENT"]:
click.echo(rev_doc.signed_raw())
click.echo("Revocation document is valid.")
......
......@@ -143,10 +143,6 @@ def patched_send_bma_revoke_error(wot_useless, rev_doc_useless):
@pytest.mark.parametrize(
("subcommand", "expected_warn"),
[
(
"verify",
False,
),
(
"publish",
True,
......@@ -265,11 +261,9 @@ def test_revocation_cli_create(file, user_input, expected, monkeypatch):
# test cli verify
@pytest.mark.parametrize(
("display", "dry_run", "doc", "lookup", "file", "expected", "not_expected"),
("doc", "lookup", "file", "expected", "not_expected"),
[
(
False,
False,
REV_DOC,
lookup_one,
"",
......@@ -277,11 +271,9 @@ def test_revocation_cli_create(file, user_input, expected, monkeypatch):
"| Public key |",
"Revocation document is valid.\n",
],
["Version: 10"],
[],
),
(
False,
False,
REV_DOC,
lookup_two,
"",
......@@ -291,50 +283,19 @@ def test_revocation_cli_create(file, user_input, expected, monkeypatch):
"| Public key |",
"Revocation document is valid.\n",
],
["Version: 10"],
),
(
True,
False,
REV_DOC,
lookup_one,
"",
[
"Version: 10",
"| Public key |",
"Revocation document is valid.\n",
],
[],
),
(
False,
True,
REV_DOC,
lookup_one,
"",
[
"Version: 10",
],
[
"Revocation document is valid.\n",
],
),
(
False,
False,
REV_DOC_FALSE,
lookup_one,
"",
["Error: the signature of the revocation document is invalid."],
[
"Version: 10",
"| Public key |",
"Revocation document is valid.\n",
],
),
(
False,
False,
REV_2,
lookup_two,
"test_doc",
......@@ -347,14 +308,11 @@ def test_revocation_cli_create(file, user_input, expected, monkeypatch):
[
"Revocation document is valid.\n",
"| Public key |",
"Version: 10",
],
),
],
)
def test_revocation_cli_verify(
display,
dry_run,
doc,
lookup,
file,
......@@ -370,8 +328,7 @@ def test_revocation_cli_verify(
monkeypatch.setattr(bc_tools, "get_head_block", patched_get_head_block_gtest)
# prepare command
command = display_dry_options(display, dry_run)
command.extend(["wot", "revocation", "verify"])
command = ["wot", "revocation", "verify"]
if file:
command.extend([file])
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment