From 015c77eae9bfc71a3e8274fa8ed646bf20dc6ec1 Mon Sep 17 00:00:00 2001 From: Sean Donnelly <23455376+seando-adsk@users.noreply.github.com> Date: Fri, 22 Mar 2024 11:46:24 -0400 Subject: [PATCH] Fix unit tests - used wrong os.getenv logic. --- cmake/modules/FindUFE.cmake | 2 +- test/lib/ufe/testMaterial.py | 6 +++--- test/lib/ufe/testUINodeGraphNode.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/modules/FindUFE.cmake b/cmake/modules/FindUFE.cmake index 6c1b31a237..1231fe68ba 100644 --- a/cmake/modules/FindUFE.cmake +++ b/cmake/modules/FindUFE.cmake @@ -68,7 +68,7 @@ if(UFE_INCLUDE_DIR AND EXISTS "${UFE_INCLUDE_DIR}/ufe/ufe.h") # Temporary. Once next Maya PR is released with UFE v5.0.0 this should # be removed (along with all the UFE_PREVIEW_VERSION_NUM checks). set(UFE_PREVIEW_VERSION_NUM 5017) - elseif(UFE_VERSION VERIFY_EQUAL "5.1.0") + elseif(UFE_VERSION VERSION_EQUAL "5.1.0") set(UFE_PREVIEW_VERSION_NUM 5100) endif() diff --git a/test/lib/ufe/testMaterial.py b/test/lib/ufe/testMaterial.py index 9955928951..917932dbdf 100644 --- a/test/lib/ufe/testMaterial.py +++ b/test/lib/ufe/testMaterial.py @@ -88,7 +88,7 @@ def testUsdNoMaterial(self): materials = materialInterface.getMaterials() self.assertEqual(len(materials), 0) - if(os.getenv('UFE_MATERIAL_HAS_HASMATERIAL')): + if(os.getenv('UFE_MATERIAL_HAS_HASMATERIAL', 'NOT-FOUND') in ('1', 'TRUE')): hasAnyMaterial = materialInterface.hasMaterial() self.assertFalse(hasAnyMaterial) @@ -108,7 +108,7 @@ def testUsdSingleMaterial(self): materials = materialInterface.getMaterials() self.assertEqual(len(materials), 1) - if(os.getenv('UFE_MATERIAL_HAS_HASMATERIAL')): + if(os.getenv('UFE_MATERIAL_HAS_HASMATERIAL', 'NOT-FOUND') in ('1', 'TRUE')): hasAnyMaterial = materialInterface.hasMaterial() self.assertTrue(hasAnyMaterial) @@ -128,7 +128,7 @@ def testUsdMultipleMaterials(self): materials = materialInterface.getMaterials() self.assertEqual(len(materials), 2) - if(os.getenv('UFE_MATERIAL_HAS_HASMATERIAL')): + if(os.getenv('UFE_MATERIAL_HAS_HASMATERIAL', 'NOT-FOUND') in ('1', 'TRUE')): hasAnyMaterial = materialInterface.hasMaterial() self.assertTrue(hasAnyMaterial) diff --git a/test/lib/ufe/testUINodeGraphNode.py b/test/lib/ufe/testUINodeGraphNode.py index 417b6ff1f3..eec11aa299 100644 --- a/test/lib/ufe/testUINodeGraphNode.py +++ b/test/lib/ufe/testUINodeGraphNode.py @@ -102,7 +102,7 @@ def testPosition(self): self.doPosAndSizeTests(uiNodeGraphNode.hasPosition, uiNodeGraphNode.setPosition, uiNodeGraphNode.getPosition, uiNodeGraphNode.setPositionCmd) - @unittest.skipUnless(os.getenv('UFE_UINODEGRAPHNODE_HAS_SIZE'), + @unittest.skipIf(os.getenv('UFE_UINODEGRAPHNODE_HAS_SIZE', 'NOT-FOUND') not in ('1', 'TRUE'), 'Testing node graph size needs newer has/get/size size methods.') def testSize(self): ball3Path = ufe.PathString.path('|transform1|proxyShape1,/Ball_set/Props/Ball_3') @@ -116,7 +116,7 @@ def testSize(self): self.doPosAndSizeTests(uiNodeGraphNode.hasSize, uiNodeGraphNode.setSize, uiNodeGraphNode.getSize, uiNodeGraphNode.setSizeCmd) - @unittest.skipUnless(os.getenv('UFE_UINODEGRAPHNODE_HAS_DISPLAYCOLOR'), + @unittest.skipIf(os.getenv('UFE_UINODEGRAPHNODE_HAS_DISPLAYCOLOR', 'NOT-FOUND') not in ('1', 'TRUE'), 'Testing node graph display color needs newer has/get/set display color methods.') def testDisplayColor(self): ball5Path = ufe.PathString.path('|transform1|proxyShape1,/Ball_set/Props/Ball_5')