From 091f162fae56b3bac146aa296c7b6572d037cf23 Mon Sep 17 00:00:00 2001 From: Dan Petersen Date: Sat, 14 Dec 2019 15:45:07 +0100 Subject: [PATCH] Additional test cases --- .travis.yml | 1 + provider_test.go | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) 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, + }) +}