bwbioinfo/KEGGAPI.jl

KEGGAPI.get_image fail test

Closed this issue · 0 comments

Function KEGGAPI.get_image fails due to HTTP package. I tried:

  • add status_exception=false to HTTP.get(url) in get_image function
  • adapt the request function to return a string from response.status == 200 if the function was KEGGAPI.info and a Vector if the function was KEGGAPI.get_image

None of my ideas worked

julia> @testset "KEGGAPI.get_image" begin
kegg_image = KEGGAPI.get_image("hsa00010")
@test isa(kegg_image, Vector)
@test length(kegg_image) > 0
@test_throws KEGGAPI.RequestError KEGGAPI.get_image("fail")
end
KEGGAPI.get_image: Test Failed at REPL[217]:5
Expression: KEGGAPI.get_image("fail")
Expected: KEGGAPI.RequestError
Thrown: HTTP.Exceptions.StatusError

Stacktrace:
[1] macro expansion
@ REPL[217]:5 [inlined]
[2] macro expansion
@ /mnt/e/software/julia-1.9.1/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
[3] top-level scope
@ REPL[217]:2
Test Summary: | Pass Fail Total Time
KEGGAPI.get_image | 2 1 3 1.3s
ERROR: Some tests did not pass: 2 passed, 1 failed, 0 errored, 0 broken.