host_test.go 559 B

123456789101112131415161718192021
  1. package render_test
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/weaveworks/common/test"
  6. "github.com/weaveworks/scope/render"
  7. "github.com/weaveworks/scope/render/expected"
  8. "github.com/weaveworks/scope/test/fixture"
  9. "github.com/weaveworks/scope/test/reflect"
  10. "github.com/weaveworks/scope/test/utils"
  11. )
  12. func TestHostRenderer(t *testing.T) {
  13. have := utils.Prune(render.HostRenderer.Render(context.Background(), fixture.Report).Nodes)
  14. want := utils.Prune(expected.RenderedHosts)
  15. if !reflect.DeepEqual(want, have) {
  16. t.Error(test.Diff(want, have))
  17. }
  18. }