You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
709 B
29 lines
709 B
package dao |
|
|
|
import ( |
|
"context" |
|
"testing" |
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
"gopkg.in/h2non/gock.v1" |
|
) |
|
|
|
func TestDao_UpdateAccFace(t *testing.T) { |
|
Convey("UpdateAccFace", t, func() { |
|
Convey("When everything goes positive", func() { |
|
defer gock.OffAll() |
|
httpMock("POST", _updateFaceURL).Reply(200).JSON(`{"code":0}`) |
|
err := d.UpdateAccFace(context.TODO(), 1, "1456") |
|
So(err, ShouldBeNil) |
|
}) |
|
Convey("When everything goes negative", func() { |
|
defer gock.OffAll() |
|
httpMock("POST", _updateFaceURL).Reply(200).JSON(`{"code":500}`) |
|
err := d.UpdateAccFace(context.TODO(), 1, "1456") |
|
Convey("Then err should be nil.", func() { |
|
So(err, ShouldNotBeNil) |
|
}) |
|
}) |
|
|
|
}) |
|
}
|
|
|