From 2fd48df9d9b8dba87ffd3c811a315dccdd321017 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 11 Jul 2018 12:52:48 -0700 Subject: [PATCH] fix test --- weed/topology/topology_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/weed/topology/topology_test.go b/weed/topology/topology_test.go index b6ee43311..07dc9c67b 100644 --- a/weed/topology/topology_test.go +++ b/weed/topology/topology_test.go @@ -1,11 +1,9 @@ package topology import ( - "fmt" "github.com/chrislusf/seaweedfs/weed/pb/master_pb" "github.com/chrislusf/seaweedfs/weed/sequence" "github.com/chrislusf/seaweedfs/weed/storage" - "github.com/kr/pretty" "testing" ) @@ -113,10 +111,14 @@ func TestAddRemoveVolume(t *testing.T) { dn.UpdateVolumes([]storage.VolumeInfo{v}) topo.RegisterVolumeLayout(v, dn) - fmt.Printf("added volume 1 \n%# v\n", pretty.Formatter(topo.ToMap())) + if _, hasCollection := topo.FindCollection(v.Collection); !hasCollection { + t.Errorf("collection %v should exist", v.Collection) + } topo.UnRegisterVolumeLayout(v, dn) - fmt.Printf("removed volume 1 \n%# v\n", pretty.Formatter(topo.ToMap())) + if _, hasCollection := topo.FindCollection(v.Collection); hasCollection { + t.Errorf("collection %v should not exist", v.Collection) + } }