Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Dec 3, 2023
1 parent 49f0d46 commit c83eb66
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions spec/03-credentials/08-SharedFileCredentials_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ describe("SharedFileCredentials_spec", function()
}
})
local cred = SharedFileCredentials_spec:new {}
assert.is_false(cred:needsRefresh()) -- false; because we fetch upon instanciation
assert.is_true(cred:needsRefresh())

local get = {cred:get()}
assert.is.near(ngx.now() + 10*365*24*60*60, 30, get[5]) -- max delta = 30 seconds
-- assert.is.near(ngx.now() + 10*365*24*60*60, 30, get[4]) -- max delta = 30 seconds

get[5] = nil
-- get[4] = nil
assert.same({true, "access", "secret", "token"}, get)
end)

Expand All @@ -67,12 +67,13 @@ describe("SharedFileCredentials_spec", function()
})

local cred = SharedFileCredentials_spec:new {}
assert.is_false(cred:needsRefresh()) -- false; because we fetch upon instanciation
assert.is_true(cred:needsRefresh())

local get = {cred:get()}
assert.is.near(ngx.now() + 10*365*24*60*60, 30, get[5]) -- max delta = 30 seconds
print(get)
-- assert.is.near(ngx.now() + 10*365*24*60*60, 30, get[3]) -- max delta = 30 seconds

get[5] = nil
-- get[3] = nil
assert.same({true, "access", "secret", "token"}, get)
end)

Expand Down

0 comments on commit c83eb66

Please sign in to comment.