本文整理汇总了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)
示例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)
示例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
示例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
示例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)
示例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)
示例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
示例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)