mirror of
https://github.com/koenrh/dnscontrol-action.git
synced 2025-01-06 07:12:49 +08:00
Update tests
This commit is contained in:
parent
0f640fa71b
commit
38a9f0dfdc
1 changed files with 12 additions and 12 deletions
|
@ -43,30 +43,30 @@ function assert_key_not_exists {
|
|||
|
||||
# Cloudflare
|
||||
@test "Cloudflare API user and key are set in credentials file" {
|
||||
export CLOUDFLARE_API_USER="info@example.com"
|
||||
export CLOUDFLARE_API_KEY="foo"
|
||||
export INPUT_CLOUDFLAREAPIUSER="info@example.com"
|
||||
export INPUT_CLOUDFLAREAPIKEY="foo"
|
||||
|
||||
run "$WORKSPACE/entrypoint.sh"
|
||||
|
||||
assert_key_equals ".cloudflare.apiuser" "\$CLOUDFLARE_API_USER"
|
||||
assert_key_equals ".cloudflare.apikey" "\$CLOUDFLARE_API_KEY"
|
||||
assert_key_equals ".cloudflare.apiuser" "\$INPUT_CLOUDFLAREAPIUSER"
|
||||
assert_key_equals ".cloudflare.apikey" "\$INPUT_CLOUDFLAREAPIKEY"
|
||||
|
||||
assert_key_not_exists ".cloudflare.accountid"
|
||||
assert_key_not_exists ".cloudflare.accountname"
|
||||
}
|
||||
|
||||
@test "Cloudflare API user and key, and optional account ID and name are set" {
|
||||
export CLOUDFLARE_API_USER="info@example.com"
|
||||
export CLOUDFLARE_API_KEY="foo"
|
||||
export CLOUDFLARE_ACCOUNT_ID="1"
|
||||
export CLOUDFLARE_ACCOUNT_NAME="Contoso"
|
||||
export INPUT_CLOUDFLAREAPIUSER="info@example.com"
|
||||
export INPUT_CLOUDFLAREAPIKEY="foo"
|
||||
export INPUT_CLOUDFLAREACCOUNTID="1"
|
||||
export INPUT_CLOUDFLAREACCOUNTNAME="Contoso"
|
||||
|
||||
run "$WORKSPACE/entrypoint.sh"
|
||||
|
||||
assert_key_equals ".cloudflare.apiuser" "\$CLOUDFLARE_API_USER"
|
||||
assert_key_equals ".cloudflare.apikey" "\$CLOUDFLARE_API_KEY"
|
||||
assert_key_equals ".cloudflare.accountid" "\$CLOUDFLARE_ACCOUNT_ID"
|
||||
assert_key_equals ".cloudflare.accountname" "\$CLOUDFLARE_ACCOUNT_NAME"
|
||||
assert_key_equals ".cloudflare.apiuser" "\$INPUT_CLOUDFLAREAPIUSER"
|
||||
assert_key_equals ".cloudflare.apikey" "\$INPUT_CLOUDFLAREAPIKEY"
|
||||
assert_key_equals ".cloudflare.accountid" "\$INPUT_CLOUDFLAREACCOUNTID"
|
||||
assert_key_equals ".cloudflare.accountname" "\$INPUT_CLOUDFLAREACCOUNTNAME"
|
||||
}
|
||||
|
||||
# DigitalOcean
|
||||
|
|
Loading…
Reference in a new issue