The way core4.api.v1.request.main.CoreBaseHandler.create_jwt()is coded right now, it calculates a token's expiry time down to the second.
The t0 in the test, however, is a timestamp that goes all the way down to microseconds.
A token with an expiry time of 8 seconds can therefore expire in 7 seconds and 49 milliseconds, and the round() function the test uses will consider this to be 7 seconds (as opposed to 7 seconds and 50 milliseconds, which would be rounded to 8).
core4.api.v1.request.main.CoreBaseHandler.create_jwt()
is coded right now, it calculates a token's expiry time down to the second.t0
in the test, however, is a timestamp that goes all the way down to microseconds.round()
function the test uses will consider this to be 7 seconds (as opposed to 7 seconds and 50 milliseconds, which would be rounded to 8).