@@ -159,22 +159,25 @@ def test_space_with_files_v4_sse_v2(self):
159
159
space_id = "gradio-tests/space_with_files_v4_sse_v2"
160
160
client = Client (space_id )
161
161
payload = (
162
- "https://audio-samples.github.io/samples/mp3/blizzard_unconditional/sample-0.mp3" ,
162
+ handle_file (
163
+ "https://audio-samples.github.io/samples/mp3/blizzard_unconditional/sample-0.mp3"
164
+ ),
163
165
{
164
- "video" : "https://github.com/gradio-app/gradio/raw/main/demo/video_component/files/world.mp4" ,
166
+ "video" : handle_file (
167
+ "https://github.com/gradio-app/gradio/raw/main/demo/video_component/files/world.mp4"
168
+ ),
165
169
"subtitle" : None ,
166
170
},
167
- "https://audio-samples.github.io/samples/mp3/blizzard_unconditional/sample-0.mp3" ,
171
+ handle_file (
172
+ "https://audio-samples.github.io/samples/mp3/blizzard_unconditional/sample-0.mp3"
173
+ ),
168
174
)
169
175
output = client .predict (* payload , api_name = "/predict" )
170
176
assert output [0 ].endswith (".wav" ) # Audio files are converted to wav
171
177
assert output [1 ]["video" ].endswith (
172
178
"world.mp4"
173
179
) # Video files are not converted by default
174
- assert (
175
- output [2 ]
176
- == "https://audio-samples.github.io/samples/mp3/blizzard_unconditional/sample-0.mp3"
177
- ) # textbox string should remain exactly the same
180
+ assert "sample-0.mp3" in output [2 ]
178
181
179
182
def test_state (self , increment_demo ):
180
183
with connect (increment_demo ) as client :
@@ -890,8 +893,8 @@ def test_numerical_to_label_space(self):
890
893
"label" : "output" ,
891
894
"type" : {"type" : {}, "description" : "any valid json" },
892
895
"python_type" : {
893
- "type" : "str " ,
894
- "description" : "filepath to JSON file " ,
896
+ "type" : "Dict[Any, Any] " ,
897
+ "description" : "any valid json " ,
895
898
},
896
899
"component" : "Label" ,
897
900
"serializer" : "JSONSerializable" ,
@@ -930,8 +933,8 @@ def test_numerical_to_label_space(self):
930
933
"label" : "output" ,
931
934
"type" : {"type" : {}, "description" : "any valid json" },
932
935
"python_type" : {
933
- "type" : "str " ,
934
- "description" : "filepath to JSON file " ,
936
+ "type" : "Dict[Any, Any] " ,
937
+ "description" : "any valid json " ,
935
938
},
936
939
"component" : "Label" ,
937
940
"serializer" : "JSONSerializable" ,
@@ -970,8 +973,8 @@ def test_numerical_to_label_space(self):
970
973
"label" : "output" ,
971
974
"type" : {"type" : {}, "description" : "any valid json" },
972
975
"python_type" : {
973
- "type" : "str " ,
974
- "description" : "filepath to JSON file " ,
976
+ "type" : "Dict[Any, Any] " ,
977
+ "description" : "any valid json " ,
975
978
},
976
979
"component" : "Label" ,
977
980
"serializer" : "JSONSerializable" ,
@@ -1266,7 +1269,9 @@ def test_download_private_file(self, gradio_temp_dir):
1266
1269
client = Client (
1267
1270
src = "gradio/zip_files" ,
1268
1271
)
1269
- url_path = "https://gradio-tests-not-actually-private-spacev4-sse.hf.space/file=lion.jpg"
1272
+ url_path = handle_file (
1273
+ "https://gradio-tests-not-actually-private-spacev4-sse.hf.space/file=lion.jpg"
1274
+ )
1270
1275
file = client .endpoints [0 ]._upload_file (url_path , 0 ) # type: ignore
1271
1276
assert file ["path" ].endswith (".jpg" )
1272
1277
0 commit comments