当前位置: 首页>>代码示例>>Python>>正文


Python CellAreaFactory.build_batch方法代码示例

本文整理汇总了Python中ichnaea.tests.factories.CellAreaFactory.build_batch方法的典型用法代码示例。如果您正苦于以下问题:Python CellAreaFactory.build_batch方法的具体用法?Python CellAreaFactory.build_batch怎么用?Python CellAreaFactory.build_batch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ichnaea.tests.factories.CellAreaFactory的用法示例。


在下文中一共展示了CellAreaFactory.build_batch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_incomplete_keys

# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import build_batch [as 别名]
    def test_incomplete_keys(self):
        cells = CellAreaFactory.build_batch(4)
        cells[0].radio = None
        cells[1].mcc = None
        cells[2].mnc = None
        cells[3].lac = None

        with self.db_call_checker() as check_db_calls:
            query = self.model_query(cells=cells)
            results = self.source.result_type().new_list()
            self.assertFalse(self.source.should_search(query, results))
            check_db_calls(rw=0, ro=0)
开发者ID:tomas-cliqz,项目名称:ichnaea,代码行数:14,代码来源:test_cell.py

示例2: test_incomplete_keys

# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import build_batch [as 别名]
    def test_incomplete_keys(self, geoip_db, http_session,
                             session_tracker, session, source, stats):
        cells = CellAreaFactory.build_batch(4)
        cells[0].radio = None
        cells[1].mcc = None
        cells[2].mnc = None
        cells[3].lac = None

        query = self.model_query(
            geoip_db, http_session, session, stats,
            cells=cells)
        results = source.result_list()
        assert not source.should_search(query, results)
        session_tracker(0)
开发者ID:crankycoder,项目名称:ichnaea,代码行数:16,代码来源:test_cell.py


注:本文中的ichnaea.tests.factories.CellAreaFactory.build_batch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。