def test__store_indices_db(self, mock_db, mock_event,
mock_pd, mock_classify,
mock_coOc, mock_pre_process,
mock_config):
mock_index = Mock(return_value=True)
mock_indice = MagicMock()
mock_indice.return_value = True
mock_indice.__len__.return_value = 40001
mock_config.return_value = 0
mock_db.store_indices.return_value = False
w = Workers()
from testfixtures import LogCapture
with LogCapture() as l:
w._store_indices_db(mock_index, mock_indice)
assert (l.__sizeof__()) > 0
assert mock_indice.append.called
assert mock_db.store_indices.called
assert mock_indice.clear.called
评论列表
文章目录