Skip to content

Commit

Permalink
Finishing updating unit test to use require
Browse files Browse the repository at this point in the history
  • Loading branch information
a-rhodes committed Oct 23, 2024
1 parent 85b82c6 commit a5addb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/config/autodiscovery/autodiscovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
)
Expand All @@ -25,7 +26,7 @@ network_devices:
`))
assert.NoError(t, err)
_, configListeners := DiscoverComponentsFromConfig()
assert.Len(t, configListeners, 1)
require.Len(t, configListeners, 1)
assert.Equal(t, "snmp", configListeners[0].Name)

err = pkgconfigsetup.Datadog().ReadConfig(strings.NewReader(`
Expand Down Expand Up @@ -57,6 +58,6 @@ network_devices:
`))
assert.NoError(t, err)
_, configListeners = DiscoverComponentsFromConfig()
assert.Len(t, configListeners, 1)
require.Len(t, configListeners, 1)
assert.Equal(t, "snmp", configListeners[0].Name)
}

0 comments on commit a5addb8

Please sign in to comment.