diff --git a/features/data/configs/encrypted_with_pw.json b/features/data/configs/encrypted_with_pw.json deleted file mode 100644 index 1a277240..00000000 --- a/features/data/configs/encrypted_with_pw.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "default_hour": 9, - "timeformat": "%Y-%m-%d %H:%M", - "linewrap": 80, - "encrypt": true, - "editor": "", - "default_minute": 0, - "highlight": true, - "password": "bad doggie no biscuit", - "journals": { - "default": "features/journals/encrypted.journal" - }, - "tagsymbols": "@" -} diff --git a/features/encryption.feature b/features/encryption.feature index d134c3bb..f28660b6 100644 --- a/features/encryption.feature +++ b/features/encryption.feature @@ -6,11 +6,6 @@ Then we should see the message "Password" and the output should contain "2013-06-10 15:40 Life is good" - Scenario: Loading an encrypted journal with password in config - Given we use the config "encrypted_with_pw.json" - When we run "jrnl -n 1" - Then the output should contain "2013-06-10 15:40 Life is good" - Scenario: Decrypting a journal Given we use the config "encrypted.json" When we run "jrnl --decrypt" and enter "bad doggie no biscuit" @@ -26,4 +21,3 @@ When we run "jrnl -n 1" and enter "swordfish" Then we should see the message "Password" and the output should contain "2013-06-10 15:40 Life is good" - diff --git a/jrnl/util.py b/jrnl/util.py index e0667cab..ddb4da59 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -49,7 +49,7 @@ def set_keychain(journal_name, password): keyring.delete_password('jrnl', journal_name) except: pass - else: + elif not TEST: keyring.set_password('jrnl', journal_name, password) def u(s): @@ -69,7 +69,7 @@ def py23_input(msg): def yesno(prompt, default=True): prompt = prompt.strip() + (" [Yn]" if default else "[yN]") raw = py23_input(prompt) - return {'y': True, 'n': False}.get(raw.lower(), default) + return {'y': True, 'n': False}.get(raw.lower(), default) def get_local_timezone(): """Returns the Olson identifier of the local timezone.