Commit e6bc0772 authored by Siraj Ravel's avatar Siraj Ravel

Test for getLocal method in DHT

parent 3f4a4e1e
...@@ -179,6 +179,7 @@ func TestValueGetSet(t *testing.T) { ...@@ -179,6 +179,7 @@ func TestValueGetSet(t *testing.T) {
if string(val) != "world" { if string(val) != "world" {
t.Fatalf("Expected 'world' got '%s'", string(val)) t.Fatalf("Expected 'world' got '%s'", string(val))
} }
} }
func TestProvides(t *testing.T) { func TestProvides(t *testing.T) {
...@@ -206,6 +207,11 @@ func TestProvides(t *testing.T) { ...@@ -206,6 +207,11 @@ func TestProvides(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
_, err = dhts[3].getLocal(u.Key("hello"))
if err != nil {
t.Fatal(err)
}
err = dhts[3].Provide(u.Key("hello")) err = dhts[3].Provide(u.Key("hello"))
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
......
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