本文整理汇总了Python中oic.oauth2.consumer.Consumer._backup方法的典型用法代码示例。如果您正苦于以下问题:Python Consumer._backup方法的具体用法?Python Consumer._backup怎么用?Python Consumer._backup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oic.oauth2.consumer.Consumer
的用法示例。
在下文中一共展示了Consumer._backup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_init
# 需要导入模块: from oic.oauth2.consumer import Consumer [as 别名]
# 或者: from oic.oauth2.consumer.Consumer import _backup [as 别名]
def test_init(self):
cons = Consumer({}, client_config=CLIENT_CONFIG,
server_info=SERVER_INFO,
**CONSUMER_CONFIG)
cons._backup("123456")
assert "123456" in cons.sdb
cons = Consumer({}, client_config=CLIENT_CONFIG, **CONSUMER_CONFIG)
assert cons.authorization_endpoint is None
cons = Consumer({}, **CONSUMER_CONFIG)
assert cons.authorization_endpoint is None
示例2: test_factory
# 需要导入模块: from oic.oauth2.consumer import Consumer [as 别名]
# 或者: from oic.oauth2.consumer.Consumer import _backup [as 别名]
def test_factory():
sdb = {}
consumer = Consumer(sdb, client_config=CLIENT_CONFIG,
server_info=SERVER_INFO, **CONSUMER_CONFIG)
sid = stateID("https://example.org/", consumer.seed)
_state = sid
consumer._backup(sid)
consumer.sdb["seed:%s" % consumer.seed] = sid
kaka = make_cookie(CLIENT_CONFIG["client_id"], _state, consumer.seed,
expire=360, path="/")
_oac = factory(kaka[1], sdb, CLIENT_CONFIG["client_id"],
client_config=CLIENT_CONFIG, server_info=SERVER_INFO,
**CONSUMER_CONFIG)
assert _oac.client_id == consumer.client_id
assert _oac.seed == consumer.seed