Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
attdona committed Jun 10, 2024
1 parent be53478 commit 36e2ad4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/register.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function register(cid::AbstractString, userid::AbstractString, pin::AbstractStri
msg = Register(msgid, cmp.id, userid, pubkey)
response = wait_response(rb, msg, request_timeout())
if isa(response, RembusTimeout)
rembuserror(code=STS_TIMEOUT)
throw(response)
elseif (response.status != STS_SUCCESS)
rembuserror(code=response.status, reason=response.data)
end
Expand Down
6 changes: 6 additions & 0 deletions test/auth/test_register.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ end
function run(url)
cmp = Rembus.Component(url)

# trigger a request timeout
ENV["REMBUS_TIMEOUT"] = 0.0
@test_throws RembusTimeout Rembus.register(url, uid, pin)
delete!(ENV, "REMBUS_TIMEOUT")
remove_keys(cmp.id)

Rembus.register(url, uid, pin)

# private key was created
Expand Down
10 changes: 2 additions & 8 deletions test/zmq/test_zmq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,9 @@ function run()
sleep(2)

# restart caronte
Rembus.caronte(wait=false, args=Dict("zmq" => 8002))
# trigger a resend_attestate()
Rembus.caronte(wait=false, args=Dict("broker"=>BROKER_NAME, "zmq" => 8002))
sleep(2)

shutdown()
sleep(2)
# restart caronte
Rembus.caronte(wait=false, args=Dict("zmq" => 8002))
sleep(2)

end

ENV["REMBUS_BASE_URL"] = "zmq://localhost:8002"
Expand Down

0 comments on commit 36e2ad4

Please sign in to comment.