// TestNodes tests that client.Nodes() returns the metafora nodes
// registered in etcd.
TestNodes tests that client.Nodes() returns the metafora nodes
registered in etcd.
// TestNodes tests that client . Nodes () returns the metafora nodes // registered in etcd .
func TestNodes(t *testing.T) {
	c := context.Background()
	eclient := testutil.NewEtcdV3Client(t)
	kvc := etcdv3.NewKV(eclient)
	eclient.Delete(c, Node1Path, etcdv3.WithPrefix())
	mclient := NewClient(Namespace, eclient)
	if _, err := kvc.Put(c, Node1Path, "0"); err != nil {
		t.Fatalf("AddChild %v returned error: %v", NodesDir, err)
	}
	if nodes, err := mclient.Nodes(); err != nil {
		t.Fatalf("Nodes returned error: %v", err)
	} else {
		for i, n := range nodes {
			t.Logf("%v -> %v", i, n)
		}
	}
}
func TestNodes ( t * testing . T ) { c := context . Background ( ) eclient := testutil . NewEtcdV3Client ( t ) kvc := etcdv3 . NewKV ( eclient ) eclient . Delete ( c , Node1Path , etcdv3 . WithPrefix ( ) ) mclient := NewClient ( Namespace , eclient ) if _ , err := kvc . Put ( c , Node1Path , " " ) ; err != nil { t . Fatalf ( " " , NodesDir , err ) } if nodes , err := mclient . Nodes ( ) ; err != nil { t . Fatalf ( " " , err ) } else { for i , n := range nodes { t . Logf ( " " , i , n ) } } }
TestNodes tests that client.Nodes() returns the metafora nodes
registered in etcd.
TestNodes tests that client . Nodes () returns the metafora nodes registered in etcd .