From ef38b896a669590e9622b7e29542694433b551fc Mon Sep 17 00:00:00 2001 From: Colin Basnett Date: Sun, 3 Aug 2025 01:50:31 -0700 Subject: [PATCH] Added unit test for import PSKs with invalid faces --- tests/data/Bat.psk | 3 +++ tests/psk_import_test.py | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/data/Bat.psk diff --git a/tests/data/Bat.psk b/tests/data/Bat.psk new file mode 100644 index 0000000..44c8408 --- /dev/null +++ b/tests/data/Bat.psk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00fa7a5b6a0d59d8484b9fc5559106ed57993899a63a4f77e997b11c4bce5325 +size 107308 diff --git a/tests/psk_import_test.py b/tests/psk_import_test.py index ed26856..c0d26d7 100644 --- a/tests/psk_import_test.py +++ b/tests/psk_import_test.py @@ -4,6 +4,7 @@ import pytest SUZANNE_FILEPATH = 'tests/data/Suzanne.psk' SARGE_FILEPATH = 'tests/data/CS_Sarge_S0_Skelmesh.pskx' SLURP_MONSTER_AXE_FILEPATH = 'tests/data/Slurp_Monster_Axe_LOD0.psk' +BAT_FILEPATH = 'tests/data/Bat.psk' @pytest.fixture(autouse=True) @@ -279,4 +280,10 @@ def test_psk_import_without_shape_keys(): assert mesh_object is not None, "Mesh object not found in the scene" assert mesh_object.type == 'MESH', "Mesh object type should be MESH" assert mesh_object.data.shape_keys is None, "Mesh object should not have shape keys" - \ No newline at end of file + + +def test_psk_import_with_invalid_faces(): + assert bpy.ops.psk.import_file( + filepath=BAT_FILEPATH, + components='MESH' + ) == {'FINISHED'}