fix test on windows
This commit is contained in:
parent
d27fb7aba6
commit
fad5b93717
|
|
@ -3,6 +3,7 @@ package unifi // nolint: testpackage
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
@ -22,7 +23,11 @@ func TestNewUnifi(t *testing.T) {
|
||||||
authReq, err := NewUnifi(c)
|
authReq, err := NewUnifi(c)
|
||||||
a.NotNil(err)
|
a.NotNil(err)
|
||||||
a.EqualValues(u, authReq.URL)
|
a.EqualValues(u, authReq.URL)
|
||||||
|
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.")
|
a.Contains(err.Error(), "connection refused", "an invalid destination should produce a connection error.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUniReq(t *testing.T) {
|
func TestUniReq(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue