Skip to content

Commit a4a3ccd

Browse files
committed
Inline unnecessary function
Signed-off-by: Timo Sand <[email protected]>
1 parent 5963fa0 commit a4a3ccd

1 file changed

Lines changed: 17 additions & 19 deletions

File tree

github/resource_github_emu_group_mapping_test.go

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,34 @@ func TestAccGithubEMUGroupMapping(t *testing.T) {
133133
teamName1 := fmt.Sprintf("%semu1-%s", testResourcePrefix, randomID)
134134
teamName2 := fmt.Sprintf("%semu2-%s", testResourcePrefix, randomID)
135135

136+
config := `
137+
resource "github_team" "test1" {
138+
name = "%s"
139+
description = "EMU group mapping test team 1"
140+
}
141+
resource "github_team" "test2" {
142+
name = "%s"
143+
description = "EMU group mapping test team 2"
144+
}
145+
resource "github_emu_group_mapping" "test" {
146+
team_slug = github_team.%s.slug
147+
group_id = %d
148+
}
149+
`
150+
136151
resource.Test(t, resource.TestCase{
137152
PreCheck: func() { skipUnlessEnterprise(t) },
138153
ProviderFactories: providerFactories,
139154
CheckDestroy: testAccCheckGithubEMUGroupMappingDestroy,
140155
Steps: []resource.TestStep{
141156
{
142-
Config: testAccGithubEMUGroupMappingTwoTeamsConfig(teamName1, teamName2, groupID, "test1"),
157+
Config: fmt.Sprintf(config, teamName1, teamName2, "test1", groupID),
143158
Check: resource.ComposeTestCheckFunc(
144159
resource.TestCheckResourceAttr("github_emu_group_mapping.test", "team_slug", teamName1),
145160
),
146161
},
147162
{
148-
Config: testAccGithubEMUGroupMappingTwoTeamsConfig(teamName1, teamName2, groupID, "test2"),
163+
Config: fmt.Sprintf(config, teamName1, teamName2, "test2", groupID),
149164
// ConfigPlanChecks: resource.ConfigPlanChecks{
150165
// PreApply: []plancheck.PlanCheck{
151166
// plancheckExpectKnownValues("github_emu_group_mapping.test", "team_slug", teamName2),
@@ -213,20 +228,3 @@ func testAccGithubEMUGroupMappingConfig(teamName string, groupID int) string {
213228
}
214229
`, teamName, groupID)
215230
}
216-
217-
func testAccGithubEMUGroupMappingTwoTeamsConfig(teamName1, teamName2 string, groupID int, useTeam string) string {
218-
return fmt.Sprintf(`
219-
resource "github_team" "test1" {
220-
name = "%s"
221-
description = "EMU group mapping test team 1"
222-
}
223-
resource "github_team" "test2" {
224-
name = "%s"
225-
description = "EMU group mapping test team 2"
226-
}
227-
resource "github_emu_group_mapping" "test" {
228-
team_slug = github_team.%s.slug
229-
group_id = %d
230-
}
231-
`, teamName1, teamName2, useTeam, groupID)
232-
}

0 commit comments

Comments
 (0)