Skip to content

Commit 7796df5

Browse files
authored
Merge branch 'master' into asdf
2 parents f97e885 + 822cdad commit 7796df5

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

test/query.jl

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,17 +405,33 @@ let file_dir = joinpath(@__DIR__, "files"), file_path = Path(file_dir)
405405
# q = query(f)
406406
# @test typeof(q) <: File{format"MP4"}
407407
end
408+
function try_download(url)
409+
try
410+
return Downloads.download(url)
411+
catch e
412+
e isa Downloads.RequestError && return nothing
413+
rethrow()
414+
end
415+
end
408416
if Base.VERSION >= v"1.6" || !Sys.iswindows()
409417
# FIXME: Windows fails to download the files on Julia 1.0
410418
@testset "OGG detection" begin
411-
f = Downloads.download("https://upload.wikimedia.org/wikipedia/commons/8/87/Annie_Oakley_shooting_glass_balls%2C_1894.ogv")
412-
q = query(f)
413-
@test typeof(q) <: File{format"OGG"}
419+
tmpfile = try_download("https://upload.wikimedia.org/wikipedia/commons/8/87/Annie_Oakley_shooting_glass_balls%2C_1894.ogv")
420+
if tmpfile == nothing
421+
@test_skip "Skipped: network unavailable (download failed)"
422+
else
423+
q = query(tmpfile)
424+
@test typeof(q) <: File{format"OGG"}
425+
end
414426
end
415427
@testset "MATROSKA detection" begin
416-
f = Downloads.download("https://upload.wikimedia.org/wikipedia/commons/1/13/Artist%E2%80%99s_impression_of_the_black_hole_inside_NGC_300_X-1_%28ESO_1004c%29.webm")
417-
q = query(f)
418-
@test typeof(q) <: File{format"MATROSKA"}
428+
tmpfile = try_download("https://upload.wikimedia.org/wikipedia/commons/1/13/Artist%E2%80%99s_impression_of_the_black_hole_inside_NGC_300_X-1_%28ESO_1004c%29.webm")
429+
if tmpfile == nothing
430+
@test_skip "Skipped: network unavailable (download failed)"
431+
else
432+
q = query(tmpfile)
433+
@test typeof(q) <: File{format"MATROSKA"}
434+
end
419435
end
420436
end
421437
@testset "WAV detection" begin

0 commit comments

Comments
 (0)