0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-01 19:12:59 +00:00
terraform-provider-proxmox/provider_test.go
2019-12-14 15:45:07 +01:00

44 lines
1.0 KiB
Go

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
package main
import (
"testing"
"github.com/hashicorp/terraform/helper/schema"
)
// TestProviderInstantiation() tests whether the Provider instance can be instantiated.
func TestProviderInstantiation(t *testing.T) {
s := Provider()
if s == nil {
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,
})
}