0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 18:42:58 +00:00

Additional test cases

This commit is contained in:
Dan Petersen 2019-12-14 15:45:07 +01:00
parent 3ba91855cc
commit 091f162fae
2 changed files with 26 additions and 0 deletions

View File

@ -6,6 +6,7 @@ cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
go:
- 1.13.x

View File

@ -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,
})
}