Skip to content

Commit

Permalink
Safer user agent test
Browse files Browse the repository at this point in the history
  • Loading branch information
christopher-dG committed Aug 13, 2021
1 parent 9c2da08 commit 1c6c1bf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/AWS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ end
end

@testset "set user agent" begin
old_user_agent = AWS.user_agent[]
new_user_agent = "new user agent"

@test AWS.user_agent[] == "AWS.jl/1.0.0"
set_user_agent(new_user_agent)
@test AWS.user_agent[] == new_user_agent
set_user_agent("AWS.jl/1.0.0")
try
@test AWS.user_agent[] == "AWS.jl/1.0.0"
set_user_agent(new_user_agent)
@test AWS.user_agent[] == new_user_agent
finally
set_user_agent(old_user_agent)
end
end

@testset "sign" begin
Expand Down

0 comments on commit 1c6c1bf

Please sign in to comment.