forked from raystack/guardian
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lifosmin Simon
committed
Oct 23, 2024
1 parent
45f0940
commit 5b22978
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package dataplex_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/goto/guardian/plugins/providers/dataplex" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestNewPolicyTagClient(t *testing.T) { | ||
t.Run("should return error if credentials are invalid", func(t *testing.T) { | ||
invalidCredentials := []byte("invalid-credentials") | ||
|
||
actualClient, actualError := dataplex.NewPolicyTagClient("test-project", "test-location", invalidCredentials) | ||
|
||
assert.Nil(t, actualClient) | ||
assert.Error(t, actualError) | ||
}) | ||
|
||
t.Run("should return client and nil error on success", func(t *testing.T) { | ||
actualClient, actualError := dataplex.NewPolicyTagClient("test-project", "test-location", nil) | ||
|
||
assert.NotNil(t, actualClient) | ||
assert.Nil(t, actualError) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters