MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestSimpleRPC

Function TestSimpleRPC

crypto/etls/conn_test.go:197–231  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

195}
196
197func TestSimpleRPC(t *testing.T) {
198 l := server()
199 Convey("get addr", t, func() {
200 addr := l.Addr().String()
201 So(addr, ShouldEqual, service)
202 })
203 Convey("server client OK", t, func() {
204 ret, err := client(pass)
205 So(ret, ShouldEqual, contentLength)
206 So(err, ShouldBeNil)
207 })
208 Convey("server client OK 100", t, func() {
209 for i := 0; i < 100; i++ {
210 ret, err := client(pass)
211 So(ret, ShouldEqual, contentLength)
212 So(err, ShouldBeNil)
213 }
214 })
215 Convey("pass not match", t, func() {
216 ret, err := client("1234")
217 So(ret, ShouldEqual, 0)
218 So(err, ShouldNotBeNil)
219 })
220 Convey("pass not match 100", t, func() {
221 for i := 0; i < 100; i++ {
222 ret, err := client("12345")
223 So(ret, ShouldEqual, 0)
224 So(err, ShouldNotBeNil)
225 }
226 })
227 Convey("server close", t, func() {
228 err := l.Close()
229 So(err, ShouldBeNil)
230 })
231}
232
233func TestComplexRPC(t *testing.T) {
234 l := serverComplex()

Callers

nothing calls this directly

Calls 5

serverFunction · 0.85
clientFunction · 0.85
AddrMethod · 0.80
CloseMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected