mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-17 12:39:38 +08:00

- Modified Godeps/Godeps.json by hand - [TEST] Updated welcome docs hash to sharness - [TEST] Updated contact doc - [TEST] disabled breaking test (t0080-repo refs local)
24 lines
509 B
Go
24 lines
509 B
Go
package dht
|
|
|
|
import (
|
|
"testing"
|
|
|
|
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
u "github.com/ipfs/go-ipfs/util"
|
|
|
|
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
|
)
|
|
|
|
func TestProviderManager(t *testing.T) {
|
|
ctx := context.Background()
|
|
mid := peer.ID("testing")
|
|
p := NewProviderManager(ctx, mid)
|
|
a := u.Key("test")
|
|
p.AddProvider(ctx, a, peer.ID("testingprovider"))
|
|
resp := p.GetProviders(ctx, a)
|
|
if len(resp) != 1 {
|
|
t.Fatal("Could not retrieve provider.")
|
|
}
|
|
p.Close()
|
|
}
|