Skip to content

Commit c8c04b3

Browse files
committed
USD Tests : Use lowercase drive letter on Windows
USD is inconsistent on the case of the drive letter when returning Windows paths. Windows is not case-sensitive, so we can safely correct case in tests.
1 parent 7ce488b commit c8c04b3

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

contrib/IECoreUSD/test/IECoreUSD/SceneCacheFileFormatTest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,10 @@ def testLinksTimeOffset( self ):
10831083
valueClip = pxr.Usd.ClipsAPI( offsetPrim )
10841084
clip = valueClip.GetClips()["default"]
10851085

1086-
self.assertEqual( clip["assetPaths"], pxr.Sdf.AssetPathArray( [pxr.Sdf.AssetPath( fileName, fileName )] ) )
1086+
self.assertEqual(
1087+
[ os.path.normcase( str( p ) ) for p in clip["assetPaths"] ],
1088+
[ os.path.normcase( str( p ) ) for p in pxr.Sdf.AssetPathArray( [ pxr.Sdf.AssetPath( fileName, fileName ) ] ) ]
1089+
)
10871090
self.assertEqual( clip["primPath"], "/{}".format( IECoreUSD.SceneCacheDataAlgo.internalRootName() ) )
10881091

10891092
self.assertEqual( clip["times"], pxr.Vt.Vec2dArray( [ pxr.Gf.Vec2d( start * fps, fps ), pxr.Gf.Vec2d( end * fps, 2.0 * fps ) ] ) )

contrib/IECoreUSD/test/IECoreUSD/USDSceneTest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2968,16 +2968,16 @@ def testTextureParameters( self ) :
29682968

29692969
self.assertEqual( network.size(), 4 )
29702970
self.assertEqual(
2971-
os.path.normpath( network.getShader( "relativeTexture" ).parameters["file"].value ),
2972-
os.path.join( os.path.dirname( __file__ ), "myTexture.tx" ),
2971+
os.path.normcase( os.path.normpath( network.getShader( "relativeTexture" ).parameters["file"].value ) ),
2972+
os.path.normcase( os.path.join( os.path.dirname( __file__ ), "myTexture.tx" ) ),
29732973
)
29742974
self.assertEqual(
2975-
os.path.normpath( network.getShader( "relativeUDIMTexture" ).parameters["file"].value ),
2976-
os.path.join( os.path.dirname( __file__ ), "myTexture.<UDIM>.tx" ),
2975+
os.path.normcase( os.path.normpath( network.getShader( "relativeUDIMTexture" ).parameters["file"].value ) ),
2976+
os.path.normcase( os.path.normpath( os.path.join( os.path.join( os.path.dirname( __file__ ) ), "myTexture.<UDIM>.tx" ) ) ),
29772977
)
29782978
self.assertEqual(
2979-
os.path.normpath( network.getShader( "udimTexture" ).parameters["file"].value ),
2980-
os.path.normpath( "/full/path/to/myTexture.<UDIM>.tx" )
2979+
os.path.normcase( os.path.normpath( network.getShader( "udimTexture" ).parameters["file"].value ) ),
2980+
os.path.normcase( os.path.normpath( "/full/path/to/myTexture.<UDIM>.tx" ) )
29812981
)
29822982

29832983
def testExposedShaderInput( self ) :

0 commit comments

Comments
 (0)