本文整理匯總了Python中keyring.set_keyring方法的典型用法代碼示例。如果您正苦於以下問題:Python keyring.set_keyring方法的具體用法?Python keyring.set_keyring怎麽用?Python keyring.set_keyring使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類keyring
的用法示例。
在下文中一共展示了keyring.set_keyring方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: config
# 需要導入模塊: import keyring [as 別名]
# 或者: from keyring import set_keyring [as 別名]
def config(config_source, auth_config_source, mocker):
import keyring
from keyring.backends.fail import Keyring
keyring.set_keyring(Keyring())
c = Config()
c.merge(config_source.config)
c.set_config_source(config_source)
c.set_auth_config_source(auth_config_source)
mocker.patch("poetry.factory.Factory.create_config", return_value=c)
mocker.patch("poetry.config.config.Config.set_config_source")
return c
示例2: mock_available_backend
# 需要導入模塊: import keyring [as 別名]
# 或者: from keyring import set_keyring [as 別名]
def mock_available_backend(backend):
import keyring
keyring.set_keyring(backend)
示例3: mock_unavailable_backend
# 需要導入模塊: import keyring [as 別名]
# 或者: from keyring import set_keyring [as 別名]
def mock_unavailable_backend():
import keyring
from keyring.backends.fail import Keyring
keyring.set_keyring(Keyring())
示例4: mock_chainer_backend
# 需要導入模塊: import keyring [as 別名]
# 或者: from keyring import set_keyring [as 別名]
def mock_chainer_backend(mocker):
from keyring.backends.fail import Keyring
mocker.patch("keyring.backend.get_all_keyring", [Keyring()])
import keyring
from keyring.backends.chainer import ChainerBackend
keyring.set_keyring(ChainerBackend())
示例5: setUp
# 需要導入模塊: import keyring [as 別名]
# 或者: from keyring import set_keyring [as 別名]
def setUp(self):
keyring.set_keyring(KeyringTestBackend())
示例6: main
# 需要導入模塊: import keyring [as 別名]
# 或者: from keyring import set_keyring [as 別名]
def main():
# The pycrypto encrypted keyring asks for a password in every launch. This is unacceptable.
if isinstance(keyring.get_keyring(), keyrings.alt.file.EncryptedKeyring):
keyring.set_keyring(keyrings.alt.file.PlaintextKeyring())