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.
26 lines
645 B
26 lines
645 B
package monitor |
|
|
|
import ( |
|
"context" |
|
"gopkg.in/h2non/gock.v1" |
|
"testing" |
|
|
|
"github.com/smartystreets/goconvey/convey" |
|
) |
|
|
|
func TestMonitorArchiveAttr(t *testing.T) { |
|
convey.Convey("ArchiveAttr", t, func(convCtx convey.C) { |
|
var ( |
|
c = context.Background() |
|
aid = int64(1212) |
|
) |
|
convCtx.Convey("When everything goes positive", func(convCtx convey.C) { |
|
defer gock.OffAll() |
|
httpMock("GET", d.URLArcAddit).Reply(200).JSON(`{"code":0,"data":{}}`) |
|
_, err := d.ArchiveAttr(c, aid) |
|
convCtx.Convey("Then err should be nil.addit should not be nil.", func(convCtx convey.C) { |
|
convCtx.So(err, convey.ShouldBeNil) |
|
}) |
|
}) |
|
}) |
|
}
|
|
|