From 7267810867fbe354e3181d0e32679582d9bf15da Mon Sep 17 00:00:00 2001 From: karimpwnz Date: Sat, 2 Jan 2021 05:13:47 +0200 Subject: [PATCH] Create behave tests for locked keyring --- features/password.feature | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/features/password.feature b/features/password.feature index 86fa7f6b..9b81f063 100644 --- a/features/password.feature +++ b/features/password.feature @@ -56,6 +56,30 @@ Feature: Using the installed keyring Scenario: Decrypt journal when keyring exists but fails # This should ask the user for the password after the keyring fails + Scenario: Encrypt journal when keyring exists but cannot be unlocked + Given we use the config "simple.yaml" + And we have a locked keyring + When we run "jrnl --encrypt" and enter + """ + karimpwnz + karimpwnz + y + """ + Then we should get no error + And the config for journal "default" should have "encrypt" set to "bool:True" + When we run "jrnl -n 1" and enter "karimpwnz" + Then we should be prompted for a password + And the output should contain "2013-06-10 15:40 Life is good" + + Scenario: Decrypt journal when keyring exists but cannot be unlocked + Given we use the config "encrypted.yaml" + And we have a locked keyring + When we run "jrnl --decrypt" and enter "bad doggie no biscuit" + Then we should get no error + And the config for journal "default" should have "encrypt" set to "bool:False" + And we should see the message "Journal decrypted" + And the journal should have 2 entries + Scenario: Mistyping your password Given we use the config "simple.yaml" When we run "jrnl --encrypt" and enter