Skip to content

Commit

Permalink
Merge 85e3c7f into 7a90628
Browse files Browse the repository at this point in the history
  • Loading branch information
egonelbre committed Sep 10, 2018
2 parents 7a90628 + 85e3c7f commit c97a03b
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 431 deletions.
158 changes: 0 additions & 158 deletions internal/test/storage.go

This file was deleted.

32 changes: 0 additions & 32 deletions internal/test/utils.go

This file was deleted.

16 changes: 12 additions & 4 deletions pkg/node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"

"storj.io/storj/internal/test"
"storj.io/storj/pkg/kademlia"
"storj.io/storj/pkg/provider"
proto "storj.io/storj/protos/overlay"
)
Expand All @@ -26,9 +26,9 @@ func TestLookup(t *testing.T) {
expectedErr error
}{
{
self: proto.Node{Id: test.NewNodeID(t), Address: &proto.NodeAddress{Address: ":7070"}},
self: proto.Node{Id: NewNodeID(t), Address: &proto.NodeAddress{Address: ":7070"}},
to: proto.Node{}, // filled after server has been started
find: proto.Node{Id: test.NewNodeID(t), Address: &proto.NodeAddress{Address: ":9090"}},
find: proto.Node{Id: NewNodeID(t), Address: &proto.NodeAddress{Address: ":9090"}},
expectedErr: nil,
},
}
Expand All @@ -37,7 +37,7 @@ func TestLookup(t *testing.T) {
lis, err := net.Listen("tcp", "127.0.0.1:0")
assert.NoError(t, err)

v.to = proto.Node{Id: test.NewNodeID(t), Address: &proto.NodeAddress{Address: lis.Addr().String()}}
v.to = proto.Node{Id: NewNodeID(t), Address: &proto.NodeAddress{Address: lis.Addr().String()}}

srv, mock, err := newTestServer(ctx)
assert.NoError(t, err)
Expand Down Expand Up @@ -89,3 +89,11 @@ func (mn *mockNodeServer) Query(ctx context.Context, req *proto.QueryRequest) (*
mn.queryCalled++
return &proto.QueryResponse{}, nil
}

// NewNodeID returns the string representation of a dht node ID
func NewNodeID(t *testing.T) string {
id, err := kademlia.NewID()
assert.NoError(t, err)

return id.String()
}
Loading

0 comments on commit c97a03b

Please sign in to comment.