Files
blender/tests/python/bl_pyapi_bmesh.py
Bastien Montagne b6cccca661 BMesh: Python: Add minimal API test for bmesh.
Hopefully will avoid critical failures like #140451 in the future.
2025-06-16 16:18:41 +02:00

32 lines
751 B
Python

# SPDX-FileCopyrightText: 2025 Blender Authors
#
# SPDX-License-Identifier: Apache-2.0
# ./blender.bin --background --python tests/python/bl_pyapi_bmesh.py -- --verbose
import bmesh
import unittest
class TestBMeshBasic(unittest.TestCase):
def test_create_uvsphere(self):
bm = bmesh.new()
bmesh.ops.create_uvsphere(
bm,
u_segments=8,
v_segments=5,
radius=1.0,
)
self.assertEqual(len(bm.verts), 34)
self.assertEqual(len(bm.edges), 72)
self.assertEqual(len(bm.faces), 40)
bm.free()
if __name__ == "__main__":
import sys
sys.argv = [__file__] + (sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else [])
unittest.main()