Commit c044d9c3 authored by Jeromy's avatar Jeromy Committed by Brian Tiger Chow

move mock routing tests to proper directory

parent 414ff341
package mockrouter
package mock
import (
"errors"
......
package bitswap
package mock
import (
"bytes"
......@@ -6,13 +6,12 @@ import (
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
"github.com/jbenet/go-ipfs/peer"
mock "github.com/jbenet/go-ipfs/routing/mock"
u "github.com/jbenet/go-ipfs/util"
)
func TestKeyNotFound(t *testing.T) {
vrs := mock.VirtualRoutingServer()
vrs := VirtualRoutingServer()
empty := vrs.Providers(u.Key("not there"))
if len(empty) != 0 {
t.Fatal("should be empty")
......@@ -25,7 +24,7 @@ func TestSetAndGet(t *testing.T) {
ID: pid,
}
k := u.Key("42")
rs := mock.VirtualRoutingServer()
rs := VirtualRoutingServer()
err := rs.Announce(p, k)
if err != nil {
t.Fatal(err)
......@@ -44,7 +43,7 @@ func TestSetAndGet(t *testing.T) {
func TestClientFindProviders(t *testing.T) {
peer := &peer.Peer{ID: []byte("42")}
rs := mock.VirtualRoutingServer()
rs := VirtualRoutingServer()
client := rs.Client(peer)
k := u.Key("hello")
......@@ -78,7 +77,7 @@ func TestClientFindProviders(t *testing.T) {
}
func TestClientOverMax(t *testing.T) {
rs := mock.VirtualRoutingServer()
rs := VirtualRoutingServer()
k := u.Key("hello")
numProvidersForHelloKey := 100
for i := 0; i < numProvidersForHelloKey; i++ {
......@@ -112,7 +111,7 @@ func TestClientOverMax(t *testing.T) {
// TODO does dht ensure won't receive self as a provider? probably not.
func TestCanceledContext(t *testing.T) {
rs := mock.VirtualRoutingServer()
rs := VirtualRoutingServer()
k := u.Key("hello")
t.Log("async'ly announce infinite stream of providers for key")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment