This commit is contained in:
Eshan Ramesh 2020-05-28 00:39:35 -04:00
parent 1a0fa82677
commit c6d8c3f4a2

View file

@ -40,6 +40,7 @@ class TestKeyring(keyring.backend.KeyringBackend):
def delete_password(self, servicename, username): def delete_password(self, servicename, username):
self.keys[servicename][username] = None self.keys[servicename][username] = None
class NoKeyring(keyring.backend.KeyringBackend): class NoKeyring(keyring.backend.KeyringBackend):
"""A test keyring that just stores its values in a hash""" """A test keyring that just stores its values in a hash"""
@ -216,10 +217,11 @@ def set_keychain(context, journal, password):
keyring.set_password("jrnl", journal, password) keyring.set_password("jrnl", journal, password)
@when('we disable the keychain') @when("we disable the keychain")
def disable_keychain(context): def disable_keychain(context):
keyring.core.set_keyring(NoKeyring()) keyring.core.set_keyring(NoKeyring())
@then("we should get an error") @then("we should get an error")
def has_error(context): def has_error(context):
assert context.exit_status != 0, context.exit_status assert context.exit_status != 0, context.exit_status