27 lines
653 B
Python
27 lines
653 B
Python
import os
|
|
import sys
|
|
import unittest
|
|
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
from bl_decimate import model_format
|
|
|
|
|
|
class ModelFormatTests(unittest.TestCase):
|
|
def test_fbx(self):
|
|
self.assertEqual(model_format("asset.FBX"), "fbx")
|
|
|
|
def test_glb(self):
|
|
self.assertEqual(model_format("asset.GLB"), "gltf")
|
|
|
|
def test_gltf(self):
|
|
self.assertEqual(model_format("asset.gltf"), "gltf")
|
|
|
|
def test_unsupported(self):
|
|
with self.assertRaisesRegex(ValueError, "unsupported model format"):
|
|
model_format("asset.obj")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|