github.com/netdata/go.d.plugin@v0.58.1/agent/vnodes/vnodes_test.go (about)

     1  // SPDX-License-Identifier: GPL-3.0-or-later
     2  
     3  package vnodes
     4  
     5  import (
     6  	"testing"
     7  
     8  	"github.com/stretchr/testify/assert"
     9  )
    10  
    11  func TestNew(t *testing.T) {
    12  	assert.NotNil(t, New("testdata"))
    13  	assert.NotNil(t, New("not_exist"))
    14  }
    15  
    16  func TestVnodes_Lookup(t *testing.T) {
    17  	req := New("testdata")
    18  
    19  	_, ok := req.Lookup("first")
    20  	assert.True(t, ok)
    21  
    22  	_, ok = req.Lookup("second")
    23  	assert.True(t, ok)
    24  
    25  	_, ok = req.Lookup("third")
    26  	assert.False(t, ok)
    27  }