Skip to content

Commit

Permalink
Fix unit tests - used wrong os.getenv logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
seando-adsk committed Mar 22, 2024
1 parent ee650f7 commit 015c77e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmake/modules/FindUFE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
6 changes: 3 additions & 3 deletions test/lib/ufe/testMaterial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions test/lib/ufe/testUINodeGraphNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand Down

0 comments on commit 015c77e

Please sign in to comment.