PR comments addressed from @jtolds

This commit is contained in:
Dennis Coyle 2018-04-18 13:07:48 -04:00
parent bfdb52f260
commit c878a1b76e
3 changed files with 13 additions and 7 deletions

View File

@ -1,3 +1,6 @@
// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package overlay
import (

View File

@ -1,3 +1,6 @@
// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package overlay
import (

View File

@ -1,3 +1,6 @@
// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package overlay
import (
@ -8,15 +11,12 @@ import (
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
proto "storj.io/storj/protos/overlay" // naming proto to avoid confusion with this package
)
const (
port = 50501
proto "github.com/coyle/storj/protos/overlay" // naming proto to avoid confusion with this package
)
func TestNewServer(t *testing.T) {
lis, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
lis, err := net.Listen("tcp", fmt.Sprintf(":%d", 0))
assert.NoError(t, err)
srv := NewServer()
@ -27,14 +27,14 @@ func TestNewServer(t *testing.T) {
}
func TestNewClient(t *testing.T) {
address := fmt.Sprintf(":%d", port)
lis, err := net.Listen("tcp", address)
lis, err := net.Listen("tcp", fmt.Sprintf(":%d", 0))
assert.NoError(t, err)
srv := NewServer()
go srv.Serve(lis)
defer srv.Stop()
address := lis.Addr().String()
c, err := NewClient(&address, grpc.WithInsecure())
assert.NoError(t, err)