mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
chore: add more tests (#4042)
This commit is contained in:
parent
64d430d424
commit
6c8073b691
@ -1,6 +1,7 @@
|
|||||||
package stat
|
package stat
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@ -28,3 +29,14 @@ func TestRemoteWriterFail(t *testing.T) {
|
|||||||
})
|
})
|
||||||
assert.NotNil(t, err)
|
assert.NotNil(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRemoteWriterError(t *testing.T) {
|
||||||
|
defer gock.Off()
|
||||||
|
|
||||||
|
gock.New("http://foo.com").ReplyError(errors.New("foo"))
|
||||||
|
writer := NewRemoteWriter("http://foo.com")
|
||||||
|
err := writer.Write(&StatReport{
|
||||||
|
Name: "bar",
|
||||||
|
})
|
||||||
|
assert.NotNil(t, err)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user