From e239f0fc1cc4cd0a313377dc61e740c46119d36f Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Tue, 25 Jul 2023 21:40:03 +0200
Subject: [PATCH] revocation verify: Remove dry-run and display options support
 (#435)

remove duplicate tests after simplification
---
 silkaj/wot/revocation.py          |  8 -----
 tests/unit/wot/test_revocation.py | 49 ++-----------------------------
 2 files changed, 3 insertions(+), 54 deletions(-)

diff --git a/silkaj/wot/revocation.py b/silkaj/wot/revocation.py
index b157c89e..64770f29 100644
--- a/silkaj/wot/revocation.py
+++ b/silkaj/wot/revocation.py
@@ -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.")
 
 
diff --git a/tests/unit/wot/test_revocation.py b/tests/unit/wot/test_revocation.py
index e7e4d46c..166b1b83 100644
--- a/tests/unit/wot/test_revocation.py
+++ b/tests/unit/wot/test_revocation.py
@@ -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:
-- 
GitLab