本文整理匯總了Python中pixelated.adapter.search.SearchEngine._write_lock方法的典型用法代碼示例。如果您正苦於以下問題:Python SearchEngine._write_lock方法的具體用法?Python SearchEngine._write_lock怎麽用?Python SearchEngine._write_lock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pixelated.adapter.search.SearchEngine
的用法示例。
在下文中一共展示了SearchEngine._write_lock方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_index_mail_secured_by_lock
# 需要導入模塊: from pixelated.adapter.search import SearchEngine [as 別名]
# 或者: from pixelated.adapter.search.SearchEngine import _write_lock [as 別名]
def test_index_mail_secured_by_lock(self):
# given
soledad_querier = mock()
lock_stub = LockStub()
when(soledad_querier).get_index_masterkey().thenReturn(INDEX_KEY)
self.assertEqual(INDEX_KEY, soledad_querier.get_index_masterkey())
se = SearchEngine(soledad_querier, self.agent_home)
se._write_lock = lock_stub
headers = {
'From': '[email protected]',
'To': '[email protected]',
'Subject': 'Some test mail',
}
# when
se.index_mail(test_helper.pixelated_mail(extra_headers=headers))
# then
self.assertTrue(lock_stub.called)