mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
helper/resource: Consolidate unit test override
I noticed we had two mechanisms for unit test override. One that dropped a sentinel into the env var, and another with a struct member on TestCase. This consolidates the two, using the cleaner struct member internal mechanism and the nicer `resource.UnitTest()` entry point.
This commit is contained in:
parent
fff30cc897
commit
8c741db144
@ -9,10 +9,9 @@ import (
|
||||
)
|
||||
|
||||
func TestState_basic(t *testing.T) {
|
||||
resource.Test(t, resource.TestCase{
|
||||
OverrideEnvVar: true,
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
resource.UnitTest(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
{
|
||||
Config: testAccState_basic,
|
||||
@ -26,10 +25,9 @@ func TestState_basic(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestState_complexOutputs(t *testing.T) {
|
||||
resource.Test(t, resource.TestCase{
|
||||
OverrideEnvVar: true,
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
resource.UnitTest(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
{
|
||||
Config: testAccState_complexOutputs,
|
||||
|
Loading…
Reference in New Issue
Block a user