You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
438 B

  1. package p2p
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. "github.com/tendermint/tendermint/proto/tendermint/p2p"
  6. )
  7. func TestValueToMetricsLabel(t *testing.T) {
  8. m := NopMetrics()
  9. r := &p2p.PexResponse{}
  10. str := m.ValueToMetricLabel(r)
  11. assert.Equal(t, "p2p_PexResponse", str)
  12. // subsequent calls to the function should produce the same result
  13. str = m.ValueToMetricLabel(r)
  14. assert.Equal(t, "p2p_PexResponse", str)
  15. }