@@ -74,6 +74,54 @@ def test_seed_prompt_initialization(seed_prompt_fixture):
7474 assert seed_prompt_fixture .parameters == ["param1" ]
7575
7676
77+ @pytest .mark .parametrize (
78+ ("suffix" , "expected_data_type" ),
79+ [
80+ # Video — uppercase
81+ (".MP4" , "video_path" ),
82+ (".AVI" , "video_path" ),
83+ (".MOV" , "video_path" ),
84+ (".MKV" , "video_path" ),
85+ (".OGV" , "video_path" ),
86+ (".FLV" , "video_path" ),
87+ (".WMV" , "video_path" ),
88+ (".WEBM" , "video_path" ),
89+ # Audio — uppercase
90+ (".FLAC" , "audio_path" ),
91+ (".MP3" , "audio_path" ),
92+ (".MPEG" , "audio_path" ),
93+ (".MPGA" , "audio_path" ),
94+ (".M4A" , "audio_path" ),
95+ (".OGG" , "audio_path" ),
96+ (".WAV" , "audio_path" ),
97+ # Image — uppercase
98+ (".JPG" , "image_path" ),
99+ (".JPEG" , "image_path" ),
100+ (".PNG" , "image_path" ),
101+ (".GIF" , "image_path" ),
102+ (".BMP" , "image_path" ),
103+ (".TIFF" , "image_path" ),
104+ (".TIF" , "image_path" ),
105+ # Mixed case
106+ (".Mp4" , "video_path" ),
107+ (".Wav" , "audio_path" ),
108+ (".Png" , "image_path" ),
109+ (".jPeG" , "image_path" ),
110+ (".FlaC" , "audio_path" ),
111+ (".wEbM" , "video_path" ),
112+ ],
113+ )
114+ def test_seed_prompt_infers_file_type_from_case_insensitive_extension (suffix , expected_data_type ):
115+ with tempfile .NamedTemporaryFile (suffix = suffix , delete = False ) as temp_file :
116+ file_path = temp_file .name
117+
118+ try :
119+ seed_prompt = SeedPrompt (value = file_path )
120+ assert seed_prompt .data_type == expected_data_type
121+ finally :
122+ os .remove (file_path )
123+
124+
77125def test_seed_prompt_render_template_success (seed_prompt_fixture ):
78126 seed_prompt_fixture .value = "Test prompt with param1={{ param1 }}"
79127 result = seed_prompt_fixture .render_template_value (param1 = "value1" )
0 commit comments