Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
update test cases for data.pagerduty_users
Browse files Browse the repository at this point in the history
  • Loading branch information
imjaroiswebdev committed Jul 20, 2022
1 parent 468969f commit a41b13d
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions pagerduty/data_source_pagerduty_users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
func TestAccDataSourcePagerDutyUsers_Basic(t *testing.T) {
teamname1 := fmt.Sprintf("tf-team-%s", acctest.RandString(5))
teamname2 := fmt.Sprintf("tf-team-%s", acctest.RandString(5))
username1 := fmt.Sprintf("tf-user-%s", acctest.RandString(5))
username1 := fmt.Sprintf("tf-user1-%s", acctest.RandString(5))
email1 := fmt.Sprintf("%[email protected]", username1)
username2 := fmt.Sprintf("tf-user-%s", acctest.RandString(5))
username2 := fmt.Sprintf("tf-user2-%s", acctest.RandString(5))
email2 := fmt.Sprintf("%[email protected]", username2)
username3 := fmt.Sprintf("tf-user-%s", acctest.RandString(5))
username3 := fmt.Sprintf("tf-user3-%s", acctest.RandString(5))
email3 := fmt.Sprintf("%[email protected]", username3)

resource.Test(t, resource.TestCase{
Expand All @@ -31,6 +31,24 @@ func TestAccDataSourcePagerDutyUsers_Basic(t *testing.T) {
testAccDataSourcePagerDutyUsersExists("data.pagerduty_users.test_by_2_team"),
resource.TestCheckResourceAttrSet(
"data.pagerduty_users.test_all_users", "users.#"),
resource.TestCheckTypeSetElemNestedAttrs(
"data.pagerduty_users.test_all_users",
"users.*",
map[string]string{
"name": username1,
}),
resource.TestCheckTypeSetElemNestedAttrs(
"data.pagerduty_users.test_all_users",
"users.*",
map[string]string{
"name": username2,
}),
resource.TestCheckTypeSetElemNestedAttrs(
"data.pagerduty_users.test_all_users",
"users.*",
map[string]string{
"name": username3,
}),
resource.TestCheckResourceAttr(
"data.pagerduty_users.test_by_1_team", "users.#", "1"),
resource.TestCheckResourceAttrSet(
Expand Down

0 comments on commit a41b13d

Please sign in to comment.