Repository: jugmac00/hibpcli

Issue:
Change the message if no leak found
The wording of messages _“Hooray, everything is safe!”_ and _“Your password is safe!”_ implies these passwords are safe. Actually they only have not been reported as unsafe _until now_.

How about: _“Your password is probably safe.”_ or _“This password has not been reported unsafe until now.”_ or let's find a better message in the discussion.


Comments:

Patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index 1d5dd93..b1f39f3 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -9,6 +9,7 @@ added
 - add the `bandit` security checker
 - add support for Python 3.9
 - add type annotations
+- improve message when there are no known leaks for a password(@eumiro)
 
 0.4.1 (30.09.2020)
 ------------------
diff --git a/src/hibpcli/cli.py b/src/hibpcli/cli.py
index 2b05521..ac754e7 100644
--- a/src/hibpcli/cli.py
+++ b/src/hibpcli/cli.py
@@ -30,7 +30,7 @@ def check_keepass(path: str, password: Optional[str]) -> None:
             click.echo("The passwords of following entries are leaked:")
             click.echo(rv)
         else:
-            click.echo("Hooray, everything is safe!")
+            click.echo("Your passwords have not been reported leaked until now.")
 
 
 @click.command()
@@ -50,7 +50,7 @@ def check_password(password: Optional[str]) -> None:
         if is_leaked:
             click.echo("Please change your password!")
         else:
-            click.echo("Your password is safe!")
+            click.echo("Your password has not been reported leaked until now.")
 
 
 main.add_command(check_keepass)


Test patch:
diff --git a/tests/test_cli_for_check_keepass.py b/tests/test_cli_for_check_keepass.py
index 88ca03d..c698180 100644
--- a/tests/test_cli_for_check_keepass.py
+++ b/tests/test_cli_for_check_keepass.py
@@ -34,7 +34,7 @@ def test_keepass_subcommand_returns_all_ok(mock_check):
     expected_output = textwrap.dedent(
         """\
         Please enter the master password for the database: 
-        Hooray, everything is safe!
+        Your passwords have not been reported leaked until now.
     """  # noqa: W291
     )
     assert result.output == expected_output
diff --git a/tests/test_cli_for_check_password.py b/tests/test_cli_for_check_password.py
index d87a37d..62a805c 100644
--- a/tests/test_cli_for_check_password.py
+++ b/tests/test_cli_for_check_password.py
@@ -19,7 +19,7 @@ def test_password_subcommand_for_leaked_password(mock_password):
 def test_password_subcommand_for_safe_password(mock_password):
     runner = CliRunner()
     result = runner.invoke(main, ["check-password", "--password", "test"])
-    expected_output = "Your password is safe!\n"
+    expected_output = "Your password has not been reported leaked until now.\n"
     assert result.output == expected_output
 
 
@@ -29,7 +29,7 @@ def test_password_subcommand_with_prompt(mock_password):
     result = runner.invoke(main, ["check-password"], input="test")
     expected_output = """\
         Please enter a password which should be checked: 
-        Your password is safe!
+        Your password has not been reported leaked until now.
     """  # noqa: W291
     assert result.output == textwrap.dedent(expected_output)