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