Skip to content

Commit

Permalink
chore: improve argument names in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bschaatsbergen committed Mar 31, 2024
1 parent 7ce2eac commit 6cf9435
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions internal/provider/false_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func TestFalseFunction_stringComparison(t *testing.T) {
{
Config: `
locals {
string_comparison = "abc" == "def"
comparison = "abc" == "def"
}
output "test" {
value = provider::assert::false(local.string_comparison)
value = provider::assert::false(local.comparison)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/http_client_error_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func TestIsHTTPClientErrorFunction_httpForbidden(t *testing.T) {
{
Config: `
locals {
forbidden = 403
status_code = 403
}
output "test" {
value = provider::assert::http_client_error(local.forbidden)
value = provider::assert::http_client_error(local.status_code)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand All @@ -69,7 +69,7 @@ func TestIsHTTPClientErrorFunction_falseCases(t *testing.T) {
{
Config: `
locals {
status_code = 201
status_code = 201
}
output "test" {
value = provider::assert::http_client_error(local.status_code)
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/http_redirect_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func TestIsHTTP3XXFunction_httpMovedPermanently(t *testing.T) {
{
Config: `
locals {
moved_permanently = 301
status_code = 301
}
output "test" {
value = provider::assert::http_redirect(local.moved_permanently)
value = provider::assert::http_redirect(local.status_code)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/http_server_error_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func TestIsHTTPServerErrorFunction_httpForbidden(t *testing.T) {
{
Config: `
locals {
forbidden = 503
status_code = 503
}
output "test" {
value = provider::assert::http_server_error(local.forbidden)
value = provider::assert::http_server_error(local.status_code)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/http_success_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func TestIsHTTP2XXFunction_httpCreated(t *testing.T) {
{
Config: `
locals {
http_created = 201
status_code = 201
}
output "test" {
value = provider::assert::http_success(local.http_created)
value = provider::assert::http_success(local.status_code)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand Down
36 changes: 18 additions & 18 deletions internal/provider/not_null_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ func TestNotNullFunction(t *testing.T) {
{
Config: `
locals {
person = {
first_name = "John"
last_name = "Doe"
obj = {
foo = "Foo"
bar = "Bar"
}
}
output "test" {
value = provider::assert::not_null(local.person)
value = provider::assert::not_null(local.obj)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand All @@ -39,7 +39,7 @@ func TestNotNullFunction(t *testing.T) {
})
}

func TestNotNullFunction_Object(t *testing.T) {
func TestNotNullFunction_object(t *testing.T) {
t.Parallel()
resource.UnitTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
Expand All @@ -50,13 +50,13 @@ func TestNotNullFunction_Object(t *testing.T) {
{
Config: `
locals {
person = {
first_name = "John"
last_name = "Doe"
obj = {
foo = "Foo"
bar = "Bar"
}
}
output "test" {
value = provider::assert::not_null(local.person)
value = provider::assert::not_null(local.obj)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand All @@ -67,7 +67,7 @@ func TestNotNullFunction_Object(t *testing.T) {
})
}

func TestNotNullFunction_String(t *testing.T) {
func TestNotNullFunction_string(t *testing.T) {
t.Parallel()
resource.UnitTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
Expand All @@ -78,10 +78,10 @@ func TestNotNullFunction_String(t *testing.T) {
{
Config: `
locals {
person = "John Doe"
name = "John Doe"
}
output "test" {
value = provider::assert::not_null(local.person)
value = provider::assert::not_null(local.name)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand All @@ -92,7 +92,7 @@ func TestNotNullFunction_String(t *testing.T) {
})
}

func TestNotNullFunction_Int(t *testing.T) {
func TestNotNullFunction_int(t *testing.T) {
t.Parallel()
resource.UnitTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
Expand All @@ -103,7 +103,7 @@ func TestNotNullFunction_Int(t *testing.T) {
{
Config: `
locals {
number = 14
number = 14
}
output "test" {
value = provider::assert::not_null(local.number)
Expand All @@ -117,7 +117,7 @@ func TestNotNullFunction_Int(t *testing.T) {
})
}

func TestNotNullFunction_Function(t *testing.T) {
func TestNotNullFunction_function(t *testing.T) {
t.Parallel()
resource.UnitTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
Expand All @@ -142,7 +142,7 @@ func TestNotNullFunction_Function(t *testing.T) {
})
}

func TestNotNullFunction_List(t *testing.T) {
func TestNotNullFunction_list(t *testing.T) {
t.Parallel()
resource.UnitTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
Expand All @@ -167,7 +167,7 @@ func TestNotNullFunction_List(t *testing.T) {
})
}

func TestNotNullFunction_Map(t *testing.T) {
func TestNotNullFunction_map(t *testing.T) {
t.Parallel()
resource.UnitTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestNotNullFunction_Map(t *testing.T) {
})
}

func TestNotNullFunction_Set(t *testing.T) {
func TestNotNullFunction_set(t *testing.T) {
t.Parallel()
resource.UnitTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
Expand Down
34 changes: 17 additions & 17 deletions internal/provider/null_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ func TestIsNullFunction(t *testing.T) {
{
Config: `
locals {
person = null
something = null
}
output "test" {
value = provider::assert::null(local.person)
value = provider::assert::null(local.something)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand All @@ -47,13 +47,13 @@ func TestIsNullFunction_falseCases(t *testing.T) {
{
Config: `
locals {
person = {
first_name = "John"
last_name = "Doe"
obj = {
foo = "Foo"
bar = "Bar"
}
}
output "test" {
value = provider::assert::null(local.person)
value = provider::assert::null(local.obj)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand All @@ -63,10 +63,10 @@ func TestIsNullFunction_falseCases(t *testing.T) {
{
Config: `
locals {
person = "John Doe"
name = "John Doe"
}
output "test" {
value = provider::assert::null(local.person)
value = provider::assert::null(local.name)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand All @@ -76,7 +76,7 @@ func TestIsNullFunction_falseCases(t *testing.T) {
{
Config: `
locals {
number = 14
number = 14
}
output "test" {
value = provider::assert::null(local.number)
Expand All @@ -89,7 +89,7 @@ func TestIsNullFunction_falseCases(t *testing.T) {
{
Config: `
locals {
number = max(1, 2)
number = max(1, 2)
}
output "test" {
value = provider::assert::null(local.number)
Expand All @@ -102,7 +102,7 @@ func TestIsNullFunction_falseCases(t *testing.T) {
{
Config: `
locals {
fruits = ["apple", "banana", "cherry"]
fruits = ["apple", "banana", "cherry"]
}
output "test" {
value = provider::assert::null(local.fruits)
Expand All @@ -115,10 +115,10 @@ func TestIsNullFunction_falseCases(t *testing.T) {
{
Config: `
locals {
kvmap = {
"first_name" = "John"
"last_name" = "Doe"
}
kvmap = {
"first_name" = "John"
"last_name" = "Doe"
}
}
output "test" {
value = provider::assert::null(local.kvmap)
Expand All @@ -131,10 +131,10 @@ func TestIsNullFunction_falseCases(t *testing.T) {
{
Config: `
locals {
set = toset(["apple", "banana", "cherry"])
set = toset(["apple", "banana", "cherry"])
}
output "test" {
value = provider::assert::null(local.set)
value = provider::assert::null(local.set)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand Down
8 changes: 4 additions & 4 deletions internal/provider/true_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func TestTrueFunction_stringComparison(t *testing.T) {
{
Config: `
locals {
string_comparison = "abc" == "abc"
comparison = "abc" == "abc"
}
output "test" {
value = provider::assert::true(local.string_comparison)
value = provider::assert::true(local.comparison)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand Down Expand Up @@ -79,10 +79,10 @@ func TestTrueFunction_falseCases(t *testing.T) {
{
Config: `
locals {
string_comparison = "abc" == "def"
comparison = "abc" == "def"
}
output "test" {
value = provider::assert::true(local.string_comparison)
value = provider::assert::true(local.comparison)
}
`,
Check: resource.ComposeAggregateTestCheckFunc(
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/valid_json_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestValidJSONFunction(t *testing.T) {
})
}

func TestValidJSONFunction_MultiLine(t *testing.T) {
func TestValidJSONFunction_multiLine(t *testing.T) {
t.Parallel()
resource.UnitTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
Expand Down Expand Up @@ -68,7 +68,7 @@ func TestValidJSONFunction_MultiLine(t *testing.T) {
})
}

func TestValidJSONFunction_EmptyJSON(t *testing.T) {
func TestValidJSONFunction_emptyJSON(t *testing.T) {
t.Parallel()
resource.UnitTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/valid_yaml_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestValidYAMLFunction(t *testing.T) {
})
}

func TestValidYAMLFunction_MultiLine(t *testing.T) {
func TestValidYAMLFunction_multiLine(t *testing.T) {
t.Parallel()
resource.UnitTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
Expand Down

0 comments on commit 6cf9435

Please sign in to comment.