本文整理汇总了Python中arctic.store.version_store.VersionStore._find_prunable_version_ids方法的典型用法代码示例。如果您正苦于以下问题:Python VersionStore._find_prunable_version_ids方法的具体用法?Python VersionStore._find_prunable_version_ids怎么用?Python VersionStore._find_prunable_version_ids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arctic.store.version_store.VersionStore
的用法示例。
在下文中一共展示了VersionStore._find_prunable_version_ids方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_prune_previous_versions_0_timeout
# 需要导入模块: from arctic.store.version_store import VersionStore [as 别名]
# 或者: from arctic.store.version_store.VersionStore import _find_prunable_version_ids [as 别名]
def test_prune_previous_versions_0_timeout():
self = create_autospec(VersionStore, _versions=Mock())
self.name = sentinel.name
self._versions = create_autospec(Collection)
self._versions.with_options.return_value.find.__name__ = 'find'
self._versions.with_options.return_value.find.return_value = []
with patch('arctic.store.version_store.dt') as dt:
dt.utcnow.return_value = datetime.datetime(2013, 10, 1)
VersionStore._find_prunable_version_ids(self, sentinel.symbol, keep_mins=0)
assert self._versions.with_options.call_args_list == [call(read_preference=ReadPreference.PRIMARY)]
assert self._versions.with_options.return_value.find.call_args_list == [
call({'$or': [{'parent': {'$exists': False}},
{'parent': []}],
'symbol': sentinel.symbol,
'_id': {'$lt': bson.ObjectId('524a10810000000000000000')}},
sort=[('version', -1)],
skip=1,
projection={'FW_POINTERS_CONFIG': 1, '_id': 1, 'SEGMENT_SHAS': 1}
)]