Skip to content

Commit 717db0a

Browse files
committed
test
1 parent 2840903 commit 717db0a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

internal/provider/user_data_source_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func TestAccUserDataSource(t *testing.T) {
5757
Username: ptr.Ref(user.Username),
5858
}
5959
resource.Test(t, resource.TestCase{
60+
IsUnitTest: true,
6061
PreCheck: func() { testAccPreCheck(t) },
6162
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
6263
Steps: []resource.TestStep{
@@ -75,6 +76,7 @@ func TestAccUserDataSource(t *testing.T) {
7576
ID: ptr.Ref(user.ID.String()),
7677
}
7778
resource.Test(t, resource.TestCase{
79+
IsUnitTest: true,
7880
PreCheck: func() { testAccPreCheck(t) },
7981
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
8082
// User by ID
@@ -92,6 +94,7 @@ func TestAccUserDataSource(t *testing.T) {
9294
Token: client.SessionToken(),
9395
}
9496
resource.Test(t, resource.TestCase{
97+
IsUnitTest: true,
9598
PreCheck: func() { testAccPreCheck(t) },
9699
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
97100
// Neither ID nor Username
@@ -104,6 +107,24 @@ func TestAccUserDataSource(t *testing.T) {
104107
})
105108
})
106109

110+
t.Run("InvalidUUIDError", func(t *testing.T) {
111+
cfg := testAccUserDataSourceConfig{
112+
URL: client.URL.String(),
113+
Token: client.SessionToken(),
114+
ID: ptr.Ref("invalid-uuid"),
115+
}
116+
resource.Test(t, resource.TestCase{
117+
IsUnitTest: true,
118+
PreCheck: func() { testAccPreCheck(t) },
119+
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
120+
Steps: []resource.TestStep{
121+
{
122+
Config: cfg.String(t),
123+
ExpectError: regexp.MustCompile(`invalid UUID length: 12`),
124+
},
125+
},
126+
})
127+
})
107128
}
108129

109130
type testAccUserDataSourceConfig struct {

0 commit comments

Comments
 (0)