本文整理汇总了Python中ichnaea.tests.factories.CellAreaFactory.create_batch方法的典型用法代码示例。如果您正苦于以下问题:Python CellAreaFactory.create_batch方法的具体用法?Python CellAreaFactory.create_batch怎么用?Python CellAreaFactory.create_batch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ichnaea.tests.factories.CellAreaFactory
的用法示例。
在下文中一共展示了CellAreaFactory.create_batch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_minimum_range_returned
# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import create_batch [as 别名]
def test_minimum_range_returned(self):
areas = CellAreaFactory.create_batch(2)
areas[0].range = LAC_MIN_ACCURACY - 2000
areas[1].range = LAC_MIN_ACCURACY + 3000
areas[1].lat = areas[0].lat + 0.2
self.session.flush()
query = self.model_query(cells=areas)
location = self.provider.locate(query)
self.check_model_location(location, areas[0], accuracy=LAC_MIN_ACCURACY)
示例2: test_minimum_radius
# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import create_batch [as 别名]
def test_minimum_radius(self):
areas = CellAreaFactory.create_batch(2)
areas[0].radius = CELLAREA_MIN_ACCURACY - 2000
areas[1].radius = CELLAREA_MIN_ACCURACY + 3000
areas[1].lat = areas[0].lat + 0.2
self.session.flush()
query = self.model_query(cells=areas)
results = self.source.search(query)
self.check_model_results(
results, [areas[0]], accuracy=CELLAREA_MIN_ACCURACY)
示例3: test_minimum_range
# 需要导入模块: from ichnaea.tests.factories import CellAreaFactory [as 别名]
# 或者: from ichnaea.tests.factories.CellAreaFactory import create_batch [as 别名]
def test_minimum_range(self):
areas = CellAreaFactory.create_batch(2)
areas[0].range = LAC_MIN_ACCURACY - 2000
areas[1].range = LAC_MIN_ACCURACY + 3000
areas[1].lat = areas[0].lat + 0.2
self.session.flush()
query = self.model_query(cells=areas)
result = self.source.search(query)
self.check_model_result(
result, areas[0],
accuracy=LAC_MIN_ACCURACY)