mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-09 16:21:01 +08:00
updating tests
This commit is contained in:
parent
529a511a79
commit
bf072895be
2 changed files with 5 additions and 5 deletions
|
|
@ -495,19 +495,19 @@ func TestUpdateNetwork(t *testing.T) {
|
|||
assert.Nil(t, err, err)
|
||||
assert.Equal(t, network.DefaultPostUp, returnedNetwork.DefaultPostUp)
|
||||
})
|
||||
t.Run("UpdatePreUP", func(t *testing.T) {
|
||||
t.Run("UpdatePostDown", func(t *testing.T) {
|
||||
type Network struct {
|
||||
DefaultPreUp string
|
||||
DefaultPostDown string
|
||||
}
|
||||
var network Network
|
||||
network.DefaultPreUp = "test string"
|
||||
network.DefaultPostDown = "test string"
|
||||
response, err := api(t, network, http.MethodPut, "http://localhost:8081/api/networks/skynet", "secretkey")
|
||||
assert.Nil(t, err, err)
|
||||
assert.Equal(t, http.StatusOK, response.StatusCode)
|
||||
defer response.Body.Close()
|
||||
err = json.NewDecoder(response.Body).Decode(&returnedNetwork)
|
||||
assert.Nil(t, err, err)
|
||||
assert.Equal(t, network.DefaultPreUp, returnedNetwork.DefaultPreUp)
|
||||
assert.Equal(t, network.DefaultPostDown, returnedNetwork.DefaultPostDown)
|
||||
})
|
||||
t.Run("UpdateKeepAlive", func(t *testing.T) {
|
||||
type Network struct {
|
||||
|
|
|
|||
|
|
@ -523,7 +523,7 @@ func TestUpdatenetwork(t *testing.T) {
|
|||
assert.Nil(t, err, err)
|
||||
assert.Equal(t, network.DefaultPostUp, returnedNetwork.DefaultPostUp)
|
||||
})
|
||||
t.Run("UpdatePreUp", func(t *testing.T) {
|
||||
t.Run("UpdatePostDown", func(t *testing.T) {
|
||||
// -------needs fixing ------
|
||||
// mismatch in models.Network between struc name and json/bson name
|
||||
// does not get updated.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue