yanic/runtime/node_test.go

25 lines
411 B
Go
Raw Permalink Normal View History

package runtime
import (
"testing"
"github.com/FreifunkBremen/yanic/data"
"github.com/stretchr/testify/assert"
)
func TestNode(t *testing.T) {
assert := assert.New(t)
node := &Node{}
assert.False(node.IsGateway())
node.Nodeinfo = &data.NodeInfo{}
assert.False(node.IsGateway())
node.Nodeinfo.VPN = true
assert.True(node.IsGateway())
node.Nodeinfo.VPN = false
assert.False(node.IsGateway())
}