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


Python CellAreaFactory.build方法代码示例

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


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

示例1: test_cell_area

# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import build [as 别名]
    def test_cell_area(self):
        cell = CellAreaFactory.build()
        cell_query = self.cell_model_query([cell])
        query = Query(cell=cell_query)

        self.assertEqual(len(query.cell), 0)
        self.assertEqual(len(query.cell_area), 1)
        self.assertEqual(query.expected_accuracy, DataAccuracy.low)
开发者ID:amolk4games,项目名称:ichnaea,代码行数:10,代码来源:test_query.py

示例2: test_cell_area_no_fallback

# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import build [as 别名]
    def test_cell_area_no_fallback(self):
        cell = CellAreaFactory.build()
        cell_query = self.cell_model_query([cell])
        query = Query(cell=cell_query, fallback={'lacf': False})

        self.assertEqual(len(query.cell), 0)
        self.assertEqual(len(query.cell_area), 0)
        self.assertEqual(query.expected_accuracy, DataAccuracy.none)
开发者ID:amolk4games,项目名称:ichnaea,代码行数:10,代码来源:test_query.py

示例3: test_cell_area_no_fallback

# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import build [as 别名]
    def test_cell_area_no_fallback(self):
        cell = CellAreaFactory.build()
        cell_query = self.cell_model_query([cell])
        query = Query(cell=cell_query, fallback={'lacf': False})

        assert len(query.cell) == 0
        assert len(query.cell_area) == 0
        assert query.expected_accuracy is DataAccuracy.none
开发者ID:crankycoder,项目名称:ichnaea,代码行数:10,代码来源:test_query.py

示例4: test_cell_area

# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import build [as 别名]
    def test_cell_area(self):
        cell = CellAreaFactory.build()
        cell_query = self.cell_model_query([cell])
        query = Query(cell=cell_query)

        assert len(query.cell) == 0
        assert len(query.cell_area) == 1
        assert query.expected_accuracy is DataAccuracy.low
开发者ID:amjadm61,项目名称:ichnaea,代码行数:10,代码来源:test_query.py

示例5: test_invalid_mcc

# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import build [as 别名]
 def test_invalid_mcc(self, geoip_db, http_session,
                      session, source, stats):
     area = CellAreaFactory.build(mcc=235, num_cells=10)
     area.mcc = 999
     query = self.model_query(
         geoip_db, http_session, session, stats,
         cells=[area])
     results = source.search(query)
     self.check_model_results(results, None)
开发者ID:crankycoder,项目名称:ichnaea,代码行数:11,代码来源:test_internal.py

示例6: test_cell_area_region

# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import build [as 别名]
 def test_cell_area_region(self):
     cell = CellAreaFactory.build()
     cell_query = self.cell_model_query([cell])
     query = Query(cell=cell_query, api_type='region')
     self.assertEqual(query.expected_accuracy, DataAccuracy.low)
开发者ID:amolk4games,项目名称:ichnaea,代码行数:7,代码来源:test_query.py

示例7: test_cell_area_region_no_fallback

# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import build [as 别名]
 def test_cell_area_region_no_fallback(self):
     cell = CellAreaFactory.build()
     cell_query = self.cell_model_query([cell])
     query = Query(cell=cell_query, api_type='region',
                   fallback={'lacf': False})
     assert query.expected_accuracy is DataAccuracy.none
开发者ID:crankycoder,项目名称:ichnaea,代码行数:8,代码来源:test_query.py

示例8: test_invalid_mcc

# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import build [as 别名]
 def test_invalid_mcc(self):
     cell = CellAreaFactory.build(mcc=235, num_cells=10)
     cell.mcc = 999
     query = self.model_query(cells=[cell])
     results = self.source.search(query)
     self.check_model_results(results, None)
开发者ID:tomas-cliqz,项目名称:ichnaea,代码行数:8,代码来源:test_internal.py


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