grpctest

package module
v0.0.0-...-e4b7faa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2018 License: MIT Imports: 12 Imported by: 0

README

grpctest

DEPRECATED: Use https://github.com/altipla-consulting/libs instead.

GoDoc Build Status

Install
go get github.com/altipla-consulting/grpctest
Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using gofmt.

Running tests

Run the tests

make test
License

MIT License

Documentation

Overview

Package grpctest helps testing GRPC services in Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireError

func RequireError(t *testing.T, err error, code codes.Code, message string)

RequireError assets that the GRPC error is the expected one.

Types

type ClientMock

type ClientMock struct {
	// contains filtered or unexported fields
}

ClientMock contains all the info needed to mock client calls.

func Mock

func Mock() *ClientMock

Mock creates a new mock client.

func (*ClientMock) Conn

func (mock *ClientMock) Conn() *grpc.ClientConn

Conn returns a GRPC connection that uses the mock client when connecting.

func (*ClientMock) Set

func (mock *ClientMock) Set(name string, handler interface{})

Set assigns a method to a handler function that will be called in the mock. The name should be only the method name, not the service nor the package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL