From d73828a054c4571d6df71331df4756466edffdb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Thu, 12 Sep 2024 15:01:22 +0200 Subject: [PATCH] test: update server type list index to ignore cx11 entry (#995) Co-authored-by: jo --- internal/servertype/data_source_test.go | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/internal/servertype/data_source_test.go b/internal/servertype/data_source_test.go index d5cc7ef26..9c8113a2b 100644 --- a/internal/servertype/data_source_test.go +++ b/internal/servertype/data_source_test.go @@ -3,10 +3,10 @@ package servertype_test import ( "testing" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hetznercloud/terraform-provider-hcloud/internal/servertype" "github.com/hetznercloud/terraform-provider-hcloud/internal/teste2e" - - "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hetznercloud/terraform-provider-hcloud/internal/testtemplate" ) @@ -77,25 +77,25 @@ func TestAccDataSourceList(t *testing.T) { ), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(all.TFID(), "server_type_ids.0", "22"), - resource.TestCheckResourceAttr(all.TFID(), "server_type_ids.1", "23"), - resource.TestCheckResourceAttr(all.TFID(), "names.0", "cpx11"), - resource.TestCheckResourceAttr(all.TFID(), "names.1", "cpx21"), - resource.TestCheckResourceAttr(all.TFID(), "descriptions.0", "CPX 11"), - resource.TestCheckResourceAttr(all.TFID(), "descriptions.1", "CPX 21"), + resource.TestCheckResourceAttr(all.TFID(), "server_type_ids.1", "22"), + resource.TestCheckResourceAttr(all.TFID(), "server_type_ids.2", "23"), + resource.TestCheckResourceAttr(all.TFID(), "names.1", "cpx11"), + resource.TestCheckResourceAttr(all.TFID(), "names.2", "cpx21"), + resource.TestCheckResourceAttr(all.TFID(), "descriptions.1", "CPX 11"), + resource.TestCheckResourceAttr(all.TFID(), "descriptions.2", "CPX 21"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.id", "22"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.name", "cpx11"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.cores", "2"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.memory", "2"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.disk", "40"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.storage_type", "local"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.cpu_type", "shared"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.architecture", "x86"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.included_traffic", "0"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.is_deprecated", "false"), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.deprecation_announced", ""), - resource.TestCheckResourceAttr(all.TFID(), "server_types.0.unavailable_after", ""), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.id", "22"), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.name", "cpx11"), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.cores", "2"), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.memory", "2"), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.disk", "40"), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.storage_type", "local"), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.cpu_type", "shared"), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.architecture", "x86"), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.included_traffic", "0"), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.is_deprecated", "false"), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.deprecation_announced", ""), + resource.TestCheckResourceAttr(all.TFID(), "server_types.1.unavailable_after", ""), ), }, },