@@ -29,81 +29,81 @@ def test_ColorSpaceAPI(self):
2929
3030 # Fetch the color space in a variety of ways
3131 assert Gf .ColorSpace .IsValid (rec2020 )
32- assert rootCsAttr .Get () == rec2020
33- assert rootCsAPI .GetColorSpaceNameAttr ().Get () == rec2020
32+ self . assertEqual ( rootCsAttr .Get (), rec2020 )
33+ self . assertEqual ( rootCsAPI .GetColorSpaceNameAttr ().Get (), rec2020 )
3434
3535 # Compute the color space
36- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (rootPrim , cache ) == rec2020
37- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (rootCsAttr , cache ) == rec2020
36+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (rootPrim , cache ), rec2020 )
37+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (rootCsAttr , cache ), rec2020 )
3838
3939 assert cache .IsCached (Sdf .Path ("/rec2020" ), rec2020 )
4040
4141 # Create a color attribute on rootPrim and verify it inherits the color space from rootPrim
4242 colorAttr = rootPrim .CreateAttribute ("color" , Sdf .ValueTypeNames .Color3f )
43- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (colorAttr , cache ) == rec2020
43+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (colorAttr , cache ), rec2020 )
4444
4545 # Create a child prim with a different color space, and verify it overrides the parent
4646 childPrim = stage .OverridePrim ("/rec2020/linSRGB" )
4747 childCsAPI = Usd .ColorSpaceAPI .Apply (childPrim )
4848 childCsAttr = childCsAPI .CreateColorSpaceNameAttr (rec709 )
49- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (childPrim , cache ) == rec709
49+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (childPrim , cache ), rec709 )
5050
5151 assert cache .IsCached (Sdf .Path ("/rec2020/linSRGB" ), rec709 )
5252
5353 # Create a color attribute on childPrim, and verify it inherits the color space from childPrim
5454 childColorAttr = childPrim .CreateAttribute ("color" , Sdf .ValueTypeNames .Color3f )
55- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (childColorAttr , cache ) == rec709
55+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (childColorAttr , cache ), rec709 )
5656
5757 # Create a grandchild prim with no color space, and verify it inherits the parent's color space
5858 grandchildPrim = stage .OverridePrim ("/rec2020/linSRGB/noColorSpace" )
59- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (grandchildPrim , cache ) == rec709
59+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (grandchildPrim , cache ), rec709 )
6060
6161 assert cache .IsCached (Sdf .Path ("/rec2020/linSRGB/noColorSpace" ), rec709 )
6262
6363 # Create a color attribute on grandchildPrim, and verify it inherits the color space from childPrim
6464 grandchildColorAttr = grandchildPrim .CreateAttribute ("color" , Sdf .ValueTypeNames .Color3f )
65- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (grandchildColorAttr , cache ) == rec709
65+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (grandchildColorAttr , cache ), rec709 )
6666
6767 # Create a root prim without assigning color space, and verify the result is empty
6868 rootPrim2 = stage .OverridePrim ("/noColorSpace" )
69- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (rootPrim2 , cache ) == ""
69+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (rootPrim2 , cache ), "" )
7070
7171 assert cache .IsCached (Sdf .Path ("/noColorSpace" ), "" )
7272
7373 # Repeat all of the preceding rootPrim tests on rootPrim2
7474 colorAttr2 = rootPrim2 .CreateAttribute ("color" , Sdf .ValueTypeNames .Color3f )
75- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (colorAttr2 , cache ) == ""
75+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (colorAttr2 , cache ), "" )
7676
7777 # Create a child prim with a different color space, and verify it overrides the parent
7878 childPrim2 = stage .OverridePrim ("/noColorSpace/linSRGB" )
7979 child2CsAPI = Usd .ColorSpaceAPI .Apply (childPrim2 )
8080 child2CsAttr = child2CsAPI .CreateColorSpaceNameAttr (rec709 )
81- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (childPrim2 , cache ) == rec709
81+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (childPrim2 , cache ), rec709 )
8282
8383 assert cache .IsCached (Sdf .Path ("/noColorSpace/linSRGB" ), rec709 )
8484
8585 # Create a color attribute on childPrim2, and verify it inherits the color space from childPrim2
8686 childColorAttr2 = childPrim2 .CreateAttribute ("color" , Sdf .ValueTypeNames .Color3f )
87- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (childColorAttr2 , cache ) == rec709
87+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (childColorAttr2 , cache ), rec709 )
8888
8989 # Create a grandchild prim with no color space, and verify it inherits the parent's color space
9090 grandchildPrim2 = stage .OverridePrim ("/noColorSpace/linSRGB/noColorSpace" )
9191 grandchild2CsAPI = Usd .ColorSpaceAPI .Apply (grandchildPrim2 )
92- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (grandchildPrim2 , cache ) == rec709
92+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (grandchildPrim2 , cache ), rec709 )
9393
9494 assert cache .IsCached (Sdf .Path ("/noColorSpace/linSRGB/noColorSpace" ), rec709 )
9595
9696 # Create a color attribute on grandchildPrim2, and verify it inherits the color space from childPrim2
9797 grandchildColorAttr2 = grandchildPrim2 .CreateAttribute ("color" , Sdf .ValueTypeNames .Color3f )
98- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (grandchildColorAttr2 , cache ) == rec709
98+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (grandchildColorAttr2 , cache ), rec709 )
9999
100100 # Test the CanApply method
101101 assert Usd .ColorSpaceAPI .CanApply (rootPrim )
102102 assert Usd .ColorSpaceAPI .CanApply (childPrim )
103103 assert Usd .ColorSpaceAPI .CanApply (grandchildPrim )
104104
105105 # Test the Get method
106- assert Usd .ColorSpaceAPI .Get (stage , Sdf .Path ("/rec2020" )).GetPrim () == rootPrim
106+ self . assertEqual ( Usd .ColorSpaceAPI .Get (stage , Sdf .Path ("/rec2020" )).GetPrim (), rootPrim )
107107
108108
109109 # Test the UsdColorSpaceDefinitionAPI. It's multipleApply so create two instances.
@@ -129,33 +129,33 @@ def test_ColorSpaceAPI(self):
129129 # set the color space on the prim itself to be testACEScg
130130 defColorSpaceAttr = defCsAPI .CreateColorSpaceNameAttr (testACEScg )
131131
132- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (defColorAttr , cache ) == testRec2020
132+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (defColorAttr , cache ), testRec2020 )
133133
134134 # verify that a prim at /colorSpaceDef/noCS has no color space
135135 noCSPrim = stage .OverridePrim (Sdf .Path ("/colorSpaceDef/noCS" ))
136- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (noCSPrim , cache ) == ""
136+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (noCSPrim , cache ), "" )
137137
138138 # create a child of defPrim, and verify it inherits the color space from defPrim
139139 childDefPrim = stage .OverridePrim (Sdf .Path ("/colorSpaceDef/noCS/defPrim/childDefPrim" ))
140140
141141 # first verify that the prim's color space is inherited from the parent
142- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (childDefPrim , cache ) == testACEScg
142+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (childDefPrim , cache ), testACEScg )
143143
144144 # create a color attribute on childDefPrim, and verify it inherits the color space from defPrim
145145 childDefColorAttr = childDefPrim .CreateAttribute ("color" , Sdf .ValueTypeNames .Color3f )
146- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (childDefColorAttr , cache ) == testACEScg
146+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (childDefColorAttr , cache ), testACEScg )
147147
148148 # set the attribute color space to testACEScg, and verify that it overrides the parent
149149 childDefColorAttr .SetColorSpace (testRec2020 )
150- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (childDefColorAttr , cache ) == testRec2020
150+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (childDefColorAttr , cache ), testRec2020 )
151151
152152 # reverify that the child prim still inherits the color space from the parent
153- assert Usd .ColorSpaceAPI .ComputeColorSpaceName (childDefPrim , cache ) == testACEScg
153+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpaceName (childDefPrim , cache ), testACEScg )
154154
155155 # since we haven't filled any data in for the test cases, if we compute the
156156 # GfColorSpace, it should be equal to a default constructed GfColorSpace.
157157 cs = Usd .ColorSpaceAPI .ComputeColorSpace (childDefPrim , cache )
158- assert cs == Gf .ColorSpace (testACEScg )
158+ self . assertEqual ( cs , Gf .ColorSpace (testACEScg ) )
159159
160160 # Create a linear aces cg color space
161161 acesCG = Gf .ColorSpace (Gf .ColorSpaceNames .LinearAP1 )
@@ -169,10 +169,10 @@ def test_ColorSpaceAPI(self):
169169 acesCGWhitePointAttr = testACEScgDefAPI .CreateWhitePointAttr (whitePoint )
170170
171171 # verify that the color space is computed correctly
172- assert testACEScgDefAPI .ComputeColorSpaceFromDefinitionAttributes () == acesCG
172+ self . assertEqual ( testACEScgDefAPI .ComputeColorSpaceFromDefinitionAttributes (), acesCG )
173173
174174 # verify it again, vs childDefPrim.
175- assert Usd .ColorSpaceAPI .ComputeColorSpace (childDefPrim , cache ) == acesCG
175+ self . assertEqual ( Usd .ColorSpaceAPI .ComputeColorSpace (childDefPrim , cache ), acesCG )
176176
177177 print ("UsdColorSpaceAPI and UsdColorSpaceDefinitionAPI tests passed" )
178178
0 commit comments