本文整理汇总了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)