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 604174c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/03-credentials/08-SharedFileCredentials_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ describe("SharedFileCredentials_spec", function()
end)

it("gets from config", function()
hook_config_file("~/.aws/config", {
hook_config_file(pl_path.expanduser("~/.aws/config"), {
default = {
aws_access_key_id = "access",
aws_secret_access_key = "secret",
aws_session_token = "token",
}
})
local cred = SharedFileCredentials_spec:new {}
assert.is_false(cred:needsRefresh()) -- false; because we fetch upon instanciation
assert.is_false(cred:needsRefresh())

local get = {cred:get()}
assert.is.near(ngx.now() + 10*365*24*60*60, 30, get[5]) -- max delta = 30 seconds
Expand All @@ -58,7 +58,7 @@ describe("SharedFileCredentials_spec", function()
end)

it("gets from credentials", function()
hook_config_file("~/.aws/credentials", {
hook_config_file(pl_path.expanduser("~/.aws/credentials"), {
default = {
aws_access_key_id = "access",
aws_secret_access_key = "secret",
Expand All @@ -67,7 +67,7 @@ describe("SharedFileCredentials_spec", function()
})

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

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

0 comments on commit 604174c

Please sign in to comment.