Skip to content

Commit

Permalink
update PostDown test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkasun committed Apr 19, 2021
1 parent 3ec0505 commit 6204b57
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,22 +473,18 @@ func TestUpdateNetwork(t *testing.T) {
assert.Equal(t, network.DefaultPostUp, returnedNetwork.DefaultPostUp)
})
t.Run("UpdatePostDown", func(t *testing.T) {
// -------needs fixing ------
// mismatch in models.Network between struc name and json/bson name
// does not get updated.

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, baseURL+"/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.DefaultPostDown)
assert.Equal(t, network.DefaultPostDown, returnedNetwork.DefaultPostDown)
})
t.Run("UpdateKeepAlive", func(t *testing.T) {
type Network struct {
Expand Down

0 comments on commit 6204b57

Please sign in to comment.