@@ -680,65 +680,24 @@ def test_interop_id(self):
680680 self .colorspace .setInteropID (valid_with_colon )
681681 self .assertEqual (self .colorspace .getInteropID (), valid_with_colon )
682682
683- # Test valid InteropID with colon in the middle.
684- valid_colon_middle = 'namespace:colorspace_name'
685- self .colorspace .setInteropID (valid_colon_middle )
686- self .assertEqual (self .colorspace .getInteropID (), valid_colon_middle )
687-
688683 # Test invalid InteropID with multiple colons.
689684 with self .assertRaises (Exception ) as context :
690685 self .colorspace .setInteropID ('name:space:cs_name' )
691686 self .assertIn ("only zero or one ':' character is allowed" , str (context .exception ))
692687
693688 # Test invalid InteropID with colon at the end.
694689 with self .assertRaises (Exception ) as context :
695- self .colorspace .setInteropID ('lin_ap1_scene :' )
690+ self .colorspace .setInteropID ('namespace :' )
696691 self .assertIn ("':' character cannot be the last character" , str (context .exception ))
697692
698- # Test invalid InteropID with three colons.
699- with self .assertRaises (Exception ) as context :
700- self .colorspace .setInteropID ('a:b:c:d' )
701- self .assertIn ("only zero or one ':' character is allowed" , str (context .exception ))
702-
703- # Test UTF-8 strings with valid single colon.
704- utf8_valid_colon = '標準:萬國碼'
705- self .colorspace .setInteropID (utf8_valid_colon )
706- self .assertEqual (self .colorspace .getInteropID (), utf8_valid_colon )
707-
708- # Test UTF-8 strings with invalid multiple colons.
709- with self .assertRaises (Exception ) as context :
710- self .colorspace .setInteropID ('標準:萬國:碼' )
711- self .assertIn ("only zero or one ':' character is allowed" , str (context .exception ))
712-
713- # Test UTF-8 strings with invalid colon at end.
693+ # Test invalid InteropID with non-ASCII characters.
714694 with self .assertRaises (Exception ) as context :
715- self .colorspace .setInteropID ('標準萬國碼:' )
716- self .assertIn ("':' character cannot be the last character " , str (context .exception ))
695+ self .colorspace .setInteropID ('café_scene' ) # Contains é (UTF-8 )
696+ self .assertIn ("contains non-ASCII characters " , str (context .exception ))
717697
718- # Test UTF-8 strings without colon (should be valid).
719- utf8_no_colon = '標準萬國碼'
720- self .colorspace .setInteropID (utf8_no_colon )
721- self .assertEqual (self .colorspace .getInteropID (), utf8_no_colon )
722-
723- # Test edge case: single colon character.
724698 with self .assertRaises (Exception ) as context :
725- self .colorspace .setInteropID (':' )
726- self .assertIn ("':' character cannot be the last character" , str (context .exception ))
727-
728- # Test edge case: colon at beginning (should be valid).
729- colon_at_beginning = ':valid_name'
730- self .colorspace .setInteropID (colon_at_beginning )
731- self .assertEqual (self .colorspace .getInteropID (), colon_at_beginning )
732-
733- # Test with Unicode characters that might look like colons but aren't ASCII colons.
734- unicode_similar = 'test:name' # This uses a full-width colon (U+FF1A), not ASCII colon
735- self .colorspace .setInteropID (unicode_similar )
736- self .assertEqual (self .colorspace .getInteropID (), unicode_similar )
737-
738- # Test mixed ASCII and Unicode with valid single ASCII colon.
739- mixed_valid = 'ñamespace:色空間'
740- self .colorspace .setInteropID (mixed_valid )
741- self .assertEqual (self .colorspace .getInteropID (), mixed_valid )
699+ self .colorspace .setInteropID ('space±_name' ) # Contains ± (ANSI 0xB1)
700+ self .assertIn ("contains non-ASCII characters" , str (context .exception ))
742701
743702 def test_amf_transform_ids (self ):
744703 """
@@ -900,7 +859,7 @@ def test_processor_to_known_colorspace(self):
900859 - !<ColorSpace>
901860 name: Linear ITU-R BT.709
902861 description: A linear Rec.709 space with an unusual spelling.
903- interop_id: "mycompany:lin_rec709_scene "
862+ interop_id: "mycompany:led_wall_1 "
904863 isdata: false
905864 from_scene_reference: !<GroupTransform>
906865 name: AP0 to Linear Rec.709 (sRGB)
0 commit comments