當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。