@@ -839,14 +839,27 @@ def test_virtual_display(self):
839839 self .assertEqual (1 , len (cfg .getViews (OCIO .VIEW_SHARED , "sRGB" )))
840840
841841 self .assertTrue (cfg .displayHasView ("sRGB" , "sview1" ))
842+ self .assertFalse (cfg .displayHasView ("sRGB" , "sview2" ))
843+ self .assertFalse (cfg .displayHasView ("sRGB" , " " ))
844+
842845 self .assertTrue (cfg .viewIsShared ("sRGB" , "sview1" ))
846+ self .assertFalse (cfg .viewIsShared ("sRGB" , "Raw" ))
847+ self .assertFalse (cfg .viewIsShared ("sRGB" , " " ))
843848
844849 other = copy .deepcopy (cfg )
845850
846851 self .assertTrue (OCIO .Config .ViewsAreEqual (cfg , other , "sRGB" , "sview1" ))
847852 self .assertTrue (OCIO .Config .ViewsAreEqual (cfg , other , "sRGB" , "Raw" ))
848853 self .assertTrue (OCIO .Config .ViewsAreEqual (cfg , other , "sRGB" , "view" ))
849854
855+ cfg .removeDisplayView ("sRGB" , "sview1" )
856+ cfg .removeDisplayView ("sRGB" , "Raw" )
857+ cfg .removeDisplayView ("sRGB" , "view" )
858+
859+ self .assertFalse (OCIO .Config .ViewsAreEqual (cfg , other , "sRGB" , "sview1" ))
860+ self .assertFalse (OCIO .Config .ViewsAreEqual (cfg , other , "sRGB" , "Raw" ))
861+ self .assertFalse (OCIO .Config .ViewsAreEqual (cfg , other , "sRGB" , "view" ))
862+
850863 # Validate the virtual display information
851864 self .assertEqual (
852865 2 ,
@@ -885,11 +898,28 @@ def test_virtual_display(self):
885898 self .assertTrue (cfg .virtualViewIsShared ("sview2" ))
886899 self .assertTrue (OCIO .Config .VirtualViewsAreEqual (cfg , other , "sview2" ))
887900
901+ other .addVirtualDisplayView ("sview3" , "" , "raw" )
902+
903+ self .assertFalse (cfg .hasVirtualView ("sview3" ))
904+ self .assertTrue (other .hasVirtualView ("sview3" ))
905+ self .assertFalse (OCIO .Config .VirtualViewsAreEqual (cfg , other , "sview3" ))
906+
907+ # Test a virtual view that doesn't exist in either
908+ self .assertFalse (cfg .hasVirtualView (" " ))
909+ self .assertFalse (other .hasVirtualView (" " ))
910+ self .assertFalse (OCIO .Config .VirtualViewsAreEqual (cfg , other , " " ))
911+
912+ self .assertFalse (cfg .hasVirtualView ("nonexistent" ))
913+ self .assertFalse (other .hasVirtualView ("nonexistent" ))
914+ self .assertFalse (OCIO .Config .VirtualViewsAreEqual (cfg , other , "nonexistent" ))
915+
888916 # Remove a view from the virtual display
889917 cfg .removeVirtualDisplayView ("Raw" )
890918
891- self .assertFalse (OCIO .Config .VirtualViewsAreEqual (cfg , other , "Raw" ))
892919 self .assertFalse (cfg .hasVirtualView ("Raw" ))
920+ self .assertTrue (other .hasVirtualView ("Raw" ))
921+
922+ self .assertFalse (OCIO .Config .VirtualViewsAreEqual (cfg , other , "Raw" ))
893923
894924 self .assertEqual (
895925 1 ,
@@ -911,6 +941,10 @@ def test_virtual_display(self):
911941
912942 self .assertFalse (cfg .hasVirtualView ("sview2" ))
913943 self .assertFalse (cfg .virtualViewIsShared ("sview2" ))
944+
945+ self .assertTrue (other .hasVirtualView ("sview2" ))
946+ self .assertTrue (other .virtualViewIsShared ("sview2" ))
947+
914948 self .assertFalse (OCIO .Config .VirtualViewsAreEqual (cfg , other , "sview2" ))
915949
916950 cfg .addVirtualDisplaySharedView ("sview2" )
0 commit comments