-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure_api_tests.jl
35 lines (32 loc) · 1.24 KB
/
azure_api_tests.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@testitem "AzureConfig" begin
# access key is obscured when printing
@test repr(AzureConfig(;
storage_account_name="a",
container_name="b",
storage_account_key="c"
)) == "AzureConfig(storage_account_name=\"a\", container_name=\"b\", storage_account_key=*****, opts=ClientOptions())"
# sas token is obscured when printing
@test repr(AzureConfig(;
storage_account_name="a",
container_name="b",
storage_sas_token="c"
)) == "AzureConfig(storage_account_name=\"a\", container_name=\"b\", storage_sas_token=*****, opts=ClientOptions())"
@test repr(AzureConfig(;
storage_account_name="a",
container_name="b",
storage_account_key="c",
host="d"
)) == "AzureConfig(storage_account_name=\"a\", container_name=\"b\", storage_account_key=*****, host=\"d\", opts=ClientOptions())"
# can only supply either access key or sas token
try
AzureConfig(;
storage_account_name="a",
container_name="b",
storage_account_key="c",
storage_sas_token="d"
)
catch e
@test e isa ErrorException
@test e.msg == "Should provide either a storage_account_key or a storage_sas_token"
end
end