Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_subdivide(self, bbox, iteration):
octree = tiling._subdivide(bbox, iteration, octree=True)
# some random tests
# ne_1[ne_1] top corner
assert octree[5][5][3:] == bbox[3:]
# ne_1[ne_0] z-value
assert octree[5][1][5] == bbox[5] - (bbox[5] / 2**iteration)
def test_point_in_bbox(self, bbox, point, result):
"""Test that a point is within the bbox of a cell"""
assert tiling._point_in_bbox(bbox, point) == result
def test_compute_root_obb(self, bbox_list, obb):
res = tiling.compute_root_obb(bbox_list)
t = [isclose(obb[i], v, rel_tol=1e-6) for i,v in enumerate(res)]
assert all(t)
def test_tileset_json(self):
tileset = tiling.generate_tileset_json()
top_level = ['asset', 'geometricError', 'root']
assert sorted(tileset.keys()) == sorted(top_level)