From fad5b93717cc9d6040d900ff1e3e280fb2feffca Mon Sep 17 00:00:00 2001 From: Cody Lee Date: Wed, 23 Nov 2022 21:50:41 -0600 Subject: [PATCH] fix test on windows --- core/unifi/unifi_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/unifi/unifi_test.go b/core/unifi/unifi_test.go index f466a950..2bd72970 100644 --- a/core/unifi/unifi_test.go +++ b/core/unifi/unifi_test.go @@ -3,6 +3,7 @@ package unifi // nolint: testpackage import ( "io/ioutil" "net/http" + "runtime" "testing" "github.com/stretchr/testify/assert" @@ -22,7 +23,11 @@ func TestNewUnifi(t *testing.T) { authReq, err := NewUnifi(c) a.NotNil(err) a.EqualValues(u, authReq.URL) - a.Contains(err.Error(), "connection refused", "an invalid destination should produce a connection error.") + if runtime.GOOS == "windows" { + a.Contains(err.Error(), "connectex: No connection", "an invalid destination should produce a connection error.") + } else { + a.Contains(err.Error(), "connection refused", "an invalid destination should produce a connection error.") + } } func TestUniReq(t *testing.T) {