Skip to content

Commit

Permalink
Allow for DNSimple User API tokens to be used by implementing the DNS…
Browse files Browse the repository at this point in the history
…IMPLE_ACCOUNT_ID and DNSIMPLE_ZONES environment variables

Update tests to check that the dnsimpleSuitableZone function works properly when the DNSIMPLE_ZONES environment variable is set
  • Loading branch information
IntegralProgrammer committed Feb 26, 2024
1 parent 26694e4 commit d0c121b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions provider/dnsimple/dnsimple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,17 @@ func testDnsimpleSuitableZone(t *testing.T) {

zone := dnsimpleSuitableZone("example-beta.example.com", zones)
assert.Equal(t, zone.Name, "example.com")

os.Setenv("DNSIMPLE_ZONES", "environment-example.com,example.environment-example.com")
mockProvider.accountID = "3"
zones, err = mockProvider.Zones(ctx)
assert.Nil(t, err)

zone = dnsimpleSuitableZone("hello.example.environment-example.com", zones)
assert.Equal(t, zone.Name, "example.environment-example.com")

os.Unsetenv("DNSIMPLE_ZONES")
mockProvider.accountID = "1"
}

func TestNewDnsimpleProvider(t *testing.T) {
Expand Down

0 comments on commit d0c121b

Please sign in to comment.