diff --git a/client_configuration_test.go b/client_configuration_test.go index bf8004f29..94480761e 100644 --- a/client_configuration_test.go +++ b/client_configuration_test.go @@ -4,7 +4,6 @@ package gosnowflake import ( "fmt" - "github.com/stretchr/testify/assert" "os" "path" "strings" @@ -60,10 +59,15 @@ func TestParseConfiguration(t *testing.T) { config, err := parseClientConfiguration(fileName) - assert := assert.New(t) - assert.Equal(nil, err, "Error should be nil") - assert.Equal(tc.ExpectedLogLevel, config.Common.LogLevel, "Log level should be as expected") - assert.Equal(tc.ExpectedLogPath, config.Common.LogPath, "Log path should be as expected") + if err != nil { + t.Fatalf("Error should be nil but was %s", err) + } + if config.Common.LogLevel != tc.ExpectedLogLevel { + t.Errorf("Log level should be %s but was %s", tc.ExpectedLogLevel, config.Common.LogLevel) + } + if config.Common.LogPath != tc.ExpectedLogPath { + t.Errorf("Log path should be %s but was %s", tc.ExpectedLogPath, config.Common.LogPath) + } }) } } @@ -82,9 +86,12 @@ func TestParseAllLogLevels(t *testing.T) { config, err := parseClientConfiguration(fileName) - assert := assert.New(t) - assert.Equal(nil, err, "Error should be nil") - assert.Equal(logLevel, config.Common.LogLevel, "Log level should be as expected") + if err != nil { + t.Fatalf("Error should be nil but was: %s", err) + } + if config.Common.LogLevel != logLevel { + t.Errorf("Log level should be %s but was %s", logLevel, config.Common.LogLevel) + } }) } } @@ -143,14 +150,17 @@ func TestParseConfigurationFails(t *testing.T) { _, err := parseClientConfiguration(fileName) - assert := assert.New(t) - assert.Equal(err != nil, true, "Error should not be nil") + if err == nil { + t.Fatal("Error should not be nil but was nil") + } errMessage := fmt.Sprint(err) expectedPrefix := "parsing client config failed" - assert.Equal(strings.HasPrefix(errMessage, expectedPrefix), true, - fmt.Sprintf("Error message: \"%s\" should start with prefix: \"%s\"", errMessage, expectedPrefix)) - assert.Equal(strings.Contains(errMessage, tc.ExpectedErrorMessageToContain), true, - fmt.Sprintf("Error message: \"%s\" should contain given phrase: \"%s\"", errMessage, tc.ExpectedErrorMessageToContain)) + if !strings.HasPrefix(errMessage, expectedPrefix) { + t.Errorf("Error message: \"%s\" should start with prefix: \"%s\"", errMessage, expectedPrefix) + } + if !strings.Contains(errMessage, tc.ExpectedErrorMessageToContain) { + t.Errorf("Error message: \"%s\" should contain given phrase: \"%s\"", errMessage, tc.ExpectedErrorMessageToContain) + } }) } } diff --git a/go.mod b/go.mod index 718e20311..d78792d8f 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,6 @@ require ( github.com/gabriel-vasile/mimetype v1.4.2 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 github.com/sirupsen/logrus v1.9.0 - github.com/stretchr/testify v1.8.1 golang.org/x/crypto v0.7.0 ) @@ -35,7 +34,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.25 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/goccy/go-json v0.10.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect @@ -52,7 +50,7 @@ require ( github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/pierrec/lz4/v4 v4.1.17 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/testify v1.8.1 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect golang.org/x/mod v0.8.0 // indirect @@ -63,5 +61,4 @@ require ( golang.org/x/text v0.8.0 // indirect golang.org/x/tools v0.6.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect )