diff --git a/.travis.yml b/.travis.yml index ff42cbca..695ca621 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ cache: directories: - $HOME/.cache/go-build - $HOME/gopath/pkg/mod + go: - 1.13.x diff --git a/provider_test.go b/provider_test.go index 4e0d2958..c0ef69dc 100644 --- a/provider_test.go +++ b/provider_test.go @@ -6,6 +6,8 @@ package main import ( "testing" + + "github.com/hashicorp/terraform/helper/schema" ) // TestProviderInstantiation() tests whether the Provider instance can be instantiated. @@ -16,3 +18,26 @@ func TestProviderInstantiation(t *testing.T) { t.Fatalf("Cannot instantiate Provider") } } + +// TestProviderSchema() tests the Provider schema. +func TestProviderSchema(t *testing.T) { + s := &schema.Resource{ + Schema: Provider().Schema, + } + + testOptionalArguments(t, s, []string{ + mkProviderVirtualEnvironment, + }) + + veSchema := testNestedSchemaExistence(t, s, mkProviderVirtualEnvironment) + + testRequiredArguments(t, veSchema, []string{ + mkProviderVirtualEnvironmentEndpoint, + mkProviderVirtualEnvironmentPassword, + mkProviderVirtualEnvironmentUsername, + }) + + testOptionalArguments(t, veSchema, []string{ + mkProviderVirtualEnvironmentInsecure, + }) +}