mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-11 18:32:08 +08:00
26 lines
792 B
Go
26 lines
792 B
Go
|
package models
|
||
|
|
||
|
// moved from controllers need work
|
||
|
//func TestUpdateNetwork(t *testing.T) {
|
||
|
// database.InitializeDatabase()
|
||
|
// createNet()
|
||
|
// network := getNet()
|
||
|
// t.Run("NetID", func(t *testing.T) {
|
||
|
// var networkupdate models.Network
|
||
|
// networkupdate.NetID = "wirecat"
|
||
|
// Range, local, err := network.Update(&networkupdate)
|
||
|
// assert.NotNil(t, err)
|
||
|
// assert.Equal(t, "NetID is not editable", err.Error())
|
||
|
// t.Log(err, Range, local)
|
||
|
// })
|
||
|
// t.Run("LocalRange", func(t *testing.T) {
|
||
|
// var networkupdate models.Network
|
||
|
// //NetID needs to be set as it will be in updateNetwork
|
||
|
// networkupdate.NetID = "skynet"
|
||
|
// networkupdate.LocalRange = "192.168.0.1/24"
|
||
|
// Range, local, err := network.Update(&networkupdate)
|
||
|
// assert.Nil(t, err)
|
||
|
// t.Log(err, Range, local)
|
||
|
// })
|
||
|
//}
|