2017-10-12 15:25:00 +02:00
|
|
|
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())
|
|
|
|
|
2019-01-24 02:56:13 +01:00
|
|
|
node.Nodeinfo = &data.Nodeinfo{}
|
2017-10-12 15:25:00 +02:00
|
|
|
assert.False(node.IsGateway())
|
|
|
|
|
|
|
|
node.Nodeinfo.VPN = true
|
|
|
|
assert.True(node.IsGateway())
|
|
|
|
|
|
|
|
node.Nodeinfo.VPN = false
|
|
|
|
assert.False(node.IsGateway())
|
|
|
|
}
|