Commit 29b26f5b authored by Steven Allen's avatar Steven Allen

fix: cleanup TestDhtProvide

And fix for peer ID formatting changes.

fixes https://github.com/ipfs/go-ipfs/pull/6222#issuecomment-483479039
parent c140b0fa
...@@ -130,17 +130,17 @@ func (tp *provider) TestDhtProvide(t *testing.T) { ...@@ -130,17 +130,17 @@ func (tp *provider) TestDhtProvide(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
provider := <-out _, ok := <-out
if ok {
t.Fatal("did not expect to find any providers")
}
self0, err := apis[0].Key().Self(ctx) self0, err := apis[0].Key().Self(ctx)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
if provider.ID.String() != "<peer.ID >" {
t.Errorf("got wrong provider: %s != %s", provider.ID.String(), self0.ID().String())
}
err = apis[0].Dht().Provide(ctx, p) err = apis[0].Dht().Provide(ctx, p)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
...@@ -151,7 +151,7 @@ func (tp *provider) TestDhtProvide(t *testing.T) { ...@@ -151,7 +151,7 @@ func (tp *provider) TestDhtProvide(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
provider = <-out provider := <-out
if provider.ID.String() != self0.ID().String() { if provider.ID.String() != self0.ID().String() {
t.Errorf("got wrong provider: %s != %s", provider.ID.String(), self0.ID().String()) t.Errorf("got wrong provider: %s != %s", provider.ID.String(), self0.ID().String())
......
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