mirror of
https://github.com/status-im/status-go.git
synced 2026-08-31 09:01:16 +00:00
* chore_: move security, version and sentry packages to pkg * fix_: more imports
31 lines
910 B
Go
31 lines
910 B
Go
package params_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/status-im/status-go/params"
|
|
"github.com/status-im/status-go/pkg/security"
|
|
)
|
|
|
|
func TestRpcProvider_GetHost(t *testing.T) {
|
|
provider := params.RpcProvider{URL: security.NewSensitiveString("https://api.example.com/path")}
|
|
expectedHost := "api.example.com"
|
|
assert.Equal(t, expectedHost, provider.GetHost())
|
|
}
|
|
|
|
func TestRpcProvider_GetFullURL(t *testing.T) {
|
|
provider := params.RpcProvider{
|
|
URL: security.NewSensitiveString("https://api.example.com"),
|
|
AuthType: params.TokenAuth,
|
|
AuthToken: security.NewSensitiveString("mytoken"),
|
|
}
|
|
expectedFullURL := "https://api.example.com/mytoken"
|
|
assert.Equal(t, expectedFullURL, provider.GetFullURL().Reveal())
|
|
|
|
provider.AuthType = params.NoAuth
|
|
expectedFullURL = "https://api.example.com"
|
|
assert.Equal(t, expectedFullURL, provider.GetFullURL().Reveal())
|
|
}
|