Skip to content

Commit

Permalink
fix: Added oneapiclient_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
willguibr committed Nov 25, 2024
1 parent 6b5c5cd commit ddb8504
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions zscaler/oneapiclient_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package zscaler

import (
"runtime"
"testing"

"github.com/stretchr/testify/require"
)

func TestUserAgent(t *testing.T) {
configuration, err := NewConfiguration()
require.NoError(t, err, "Creating a new config should not error")
userAgent := "zscaler-sdk-go/" + VERSION + " golang/" + runtime.Version() + " " + runtime.GOOS + "/" + runtime.GOARCH
require.Equal(t, userAgent, configuration.UserAgent)
}

func TestUserAgentWithExtra(t *testing.T) {
configuration, err := NewConfiguration(
WithUserAgentExtra("extra/info"),
)
require.NoError(t, err, "Creating a new config should not error")
userAgent := "zscaler-sdk-go/" + VERSION + " golang/" + runtime.Version() + " " + runtime.GOOS + "/" + runtime.GOARCH + " extra/info"
require.Equal(t, userAgent, configuration.UserAgent)
}

0 comments on commit ddb8504

Please sign in to comment.