From 8dec36ff3dba4ea1fc24c074c7eb9e6f59c18b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 17 May 2023 14:01:35 +0200 Subject: [PATCH] python: adapt MeshTools filter test comments to Magnum updates. What was "not implenented yet" before is now a documented behavior. --- src/python/magnum/test/test_meshtools.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/python/magnum/test/test_meshtools.py b/src/python/magnum/test/test_meshtools.py index 0dfdf53..c3cbe21 100644 --- a/src/python/magnum/test/test_meshtools.py +++ b/src/python/magnum/test/test_meshtools.py @@ -104,14 +104,14 @@ class GenerateIndices(unittest.TestCase): with self.assertRaisesRegex(AssertionError, "invalid mesh primitive"): meshtools.generate_indices(mesh) -class FilterAttributes(unittest.TestCase): - def test_only(self): +class Filter(unittest.TestCase): + def test_only_attributes(self): mesh = primitives.cube_solid() mesh_refcount = sys.getrefcount(mesh) self.assertEqual(mesh.attribute_count(), 2) self.assertTrue(mesh.has_attribute(trade.MeshAttribute.NORMAL)) - # Currently it doesn't blow up if unknown attributes are listed + # Attributes that are not present in the mesh are deliberately ignored filtered = meshtools.filter_only_attributes(mesh, [trade.MeshAttribute.TEXTURE_COORDINATES, trade.MeshAttribute.NORMAL]) filtered_refcount = sys.getrefcount(filtered) self.assertEqual(filtered.attribute_count(), 1) @@ -134,13 +134,13 @@ class FilterAttributes(unittest.TestCase): del filtered2 self.assertEqual(sys.getrefcount(mesh), mesh_refcount) - def test_except(self): + def test_except_attributes(self): mesh = primitives.cube_solid() mesh_refcount = sys.getrefcount(mesh) self.assertEqual(mesh.attribute_count(), 2) self.assertTrue(mesh.has_attribute(trade.MeshAttribute.NORMAL)) - # Currently it doesn't blow up if unknown attributes are listed + # Attributes that are not present in the mesh are deliberately ignored filtered = meshtools.filter_except_attributes(mesh, [trade.MeshAttribute.TEXTURE_COORDINATES, trade.MeshAttribute.NORMAL]) filtered_refcount = sys.getrefcount(filtered) self.assertEqual(filtered.attribute_count(), 1)