本文整理匯總了Python中database.memcached_database.MemcachedDatabase.pop_password方法的典型用法代碼示例。如果您正苦於以下問題:Python MemcachedDatabase.pop_password方法的具體用法?Python MemcachedDatabase.pop_password怎麽用?Python MemcachedDatabase.pop_password使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類database.memcached_database.MemcachedDatabase
的用法示例。
在下文中一共展示了MemcachedDatabase.pop_password方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_add_and_pop
# 需要導入模塊: from database.memcached_database import MemcachedDatabase [as 別名]
# 或者: from database.memcached_database.MemcachedDatabase import pop_password [as 別名]
def test_add_and_pop(self):
'''Adds a password and pops it again.'''
database = MemcachedDatabase()
database.add_password("test_add_and_pop_8341")
database.pop_password("test_add_and_pop_8341")
示例2: test_double_pop
# 需要導入模塊: from database.memcached_database import MemcachedDatabase [as 別名]
# 或者: from database.memcached_database.MemcachedDatabase import pop_password [as 別名]
def test_double_pop(self):
'''Tries to pop a password twice. Should raise an exception.'''
database = MemcachedDatabase()
database.add_password("test_double_pop_9864")
database.pop_password("test_double_pop_9864")
with self.assertRaises(InvalidPasswordError):
database.pop_password("test_double_pop_9864")
示例3: test_not_exist_password
# 需要導入模塊: from database.memcached_database import MemcachedDatabase [as 別名]
# 或者: from database.memcached_database.MemcachedDatabase import pop_password [as 別名]
def test_not_exist_password(self):
'''Tries to pop a password that does not exists. Should raise an exception.'''
database = MemcachedDatabase()
with self.assertRaises(InvalidPasswordError):
database.pop_password("not_exist_password_1873")