Skip to content

Commit

Permalink
[chore] update test to use Contains (#35875)
Browse files Browse the repository at this point in the history
This follows the recommendations from the new lint version

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten authored Oct 18, 2024
1 parent 633ed51 commit 29d0174
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions receiver/snmpreceiver/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"fmt"
"math"
"strconv"
"strings"
"testing"

"github.com/gosnmp/gosnmp"
Expand Down Expand Up @@ -83,9 +82,9 @@ func TestNewClient(t *testing.T) {
func compareConfigToClient(t *testing.T, client *snmpClient, cfg *Config) {
t.Helper()

require.True(t, strings.Contains(cfg.Endpoint, client.client.GetTarget()))
require.True(t, strings.Contains(cfg.Endpoint, strconv.FormatInt(int64(client.client.GetPort()), 10)))
require.True(t, strings.Contains(cfg.Endpoint, client.client.GetTransport()))
require.Contains(t, cfg.Endpoint, client.client.GetTarget())
require.Contains(t, cfg.Endpoint, strconv.FormatInt(int64(client.client.GetPort()), 10))
require.Contains(t, cfg.Endpoint, client.client.GetTransport())
switch cfg.Version {
case "v1":
require.Equal(t, gosnmp.Version1, client.client.GetVersion())
Expand Down

0 comments on commit 29d0174

Please sign in to comment.