Skip to content

Commit

Permalink
updated test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ndortega committed Jan 11, 2024
1 parent 5057e76 commit 9f6e535
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
35 changes: 17 additions & 18 deletions src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -681,27 +681,26 @@ end

# add the swagger and swagger/schema routes
function setupswagger()

if isdocsenabled()

if !isdocsenabled()
return
end

@get "$docspath" function()
return swaggerhtml()
end

@get "$docspath/swagger" function()
return swaggerhtml()
end

@get "$docspath/redoc" function()
return redochtml()
@get "$docspath" function()
return swaggerhtml()
end

@get "$docspath/swagger" function()
return swaggerhtml()
end

@get "$docspath/redoc" function()
return redochtml()
end

@get "$(getschemapath())" function()
return getschema()
end
end

@get "$(getschemapath())" function()
return getschema()
end

end

# add the swagger and swagger/schema routes
Expand Down
6 changes: 5 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ StructTypes.StructType(::Type{Person}) = StructTypes.Struct()
@staticfiles "content"

# mount files under /dynamic
@dynamicfiles "content" "dynamic"
@dynamicfiles "content" "/dynamic"

@get "/killserver" function ()
terminate()
Expand Down Expand Up @@ -316,6 +316,10 @@ end

serve(async=true)

# query metrics endpoints
r = internalrequest(HTTP.Request("GET", "/docs/metrics/data/15/null"))
@test r.status == 200

r = internalrequest(HTTP.Request("GET", "/anonymous"))
@test r.status == 200
@test text(r) == "no args"
Expand Down

0 comments on commit 9f6e535

Please sign in to comment.