From a2ebc031198a33a3bb422c37a638d077e726aeb9 Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Tue, 7 Jun 2022 08:52:46 +0200
Subject: [PATCH] [fix] Partial revert of previous revocation changes

To be compatible with mypy, pylint, pytest
Returning in case of dry-run
Not returning a value since mypy and pylint complain
that every parts of the functions should return an integer
---
 silkaj/revocation.py     | 4 ++++
 tests/test_revocation.py | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/silkaj/revocation.py b/silkaj/revocation.py
index f26422d6..23c81380 100644
--- a/silkaj/revocation.py
+++ b/silkaj/revocation.py
@@ -54,6 +54,7 @@ def save(ctx: click.Context, file: str) -> None:
 
     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())
@@ -85,6 +86,7 @@ def revoke_now(ctx: click.Context) -> None:
 
     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())
@@ -110,6 +112,7 @@ def verify(ctx: click.Context, file: str) -> None:
 
     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())
@@ -136,6 +139,7 @@ def publish(ctx: click.Context, file: str) -> 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())
diff --git a/tests/test_revocation.py b/tests/test_revocation.py
index 9056f962..956a5d7a 100644
--- a/tests/test_revocation.py
+++ b/tests/test_revocation.py
@@ -367,9 +367,10 @@ def test_revocation_cli_save(display, dry_run, file, user_input, expected, monke
             "",
             [
                 "Version: 10",
+            ],
+            [
                 "Revocation document is valid.\n",
             ],
-            [],
         ),
         (
             False,
-- 
GitLab