summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/agent/vnodes/vnodes_test.go
blob: fc2c2ef35899771342cfbfe6bdd9d5e2de5f8437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-License-Identifier: GPL-3.0-or-later

package vnodes

import (
	"testing"

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

func TestNew(t *testing.T) {
	assert.NotNil(t, New("testdata"))
	assert.NotNil(t, New("not_exist"))
}

func TestVnodes_Lookup(t *testing.T) {
	req := New("testdata")

	_, ok := req.Lookup("first")
	assert.True(t, ok)

	_, ok = req.Lookup("second")
	assert.True(t, ok)

	_, ok = req.Lookup("third")
	assert.False(t, ok)
}