88 "testing"
99
1010 "github.com/stretchr/testify/assert"
11+ "github.com/stretchr/testify/require"
1112
1213 "github.com/coollabsio/coolify-cli/internal/ssh"
1314)
@@ -84,7 +85,7 @@ func TestCooldApply_SendsJSONPayload(t *testing.T) {
8485 Proto : "tcp" , Port : 80 ,
8586 }
8687 err := CooldApply (context .Background (), fr , "h1" , "root" , 22 , 8443 , "wg0" , "t" , r )
87- assert .NoError (t , err )
88+ require .NoError (t , err )
8889 assert .Len (t , fr .calls , 1 )
8990 assert .Contains (t , fr .calls [0 ], `"src":"10.0.0.1"` )
9091 assert .Contains (t , fr .calls [0 ], `"dst":"10.0.0.2"` )
@@ -98,7 +99,7 @@ func TestCooldApply_OmitsProtoWhenEmpty(t *testing.T) {
9899 Src : net .ParseIP ("10.0.0.1" ), Dst : net .ParseIP ("10.0.0.2" ),
99100 }
100101 err := CooldApply (context .Background (), fr , "h1" , "root" , 22 , 8443 , "wg0" , "t" , r )
101- assert .NoError (t , err )
102+ require .NoError (t , err )
102103 // omitempty drops zero port and empty proto — avoids tripping coold's
103104 // "port requires proto" validation.
104105 assert .NotContains (t , fr .calls [0 ], `"proto"` )
@@ -120,7 +121,7 @@ func TestCooldList_ParsesJSON(t *testing.T) {
120121 ]` ,
121122 }}
122123 rules , err := CooldList (context .Background (), fr , "h1" , "root" , 22 , 8443 , "wg0" , "t" , "" )
123- assert .NoError (t , err )
124+ require .NoError (t , err )
124125 assert .Len (t , rules , 2 )
125126 assert .Equal (t , "h1" , rules [0 ].Host )
126127 assert .Equal (t , "cid:abc123def456" , rules [0 ].Comment )
@@ -135,7 +136,7 @@ func TestCooldList_ParsesJSON(t *testing.T) {
135136func TestCooldList_EmptyBody (t * testing.T ) {
136137 fr := & fakeCooldRunner {}
137138 rules , err := CooldList (context .Background (), fr , "h1" , "root" , 22 , 8443 , "wg0" , "t" , "" )
138- assert .NoError (t , err )
139+ require .NoError (t , err )
139140 assert .Empty (t , rules )
140141}
141142
@@ -159,7 +160,7 @@ func TestFetchCooldToken_ReadsFile(t *testing.T) {
159160 "/etc/coolify/api-token" : "deadbeefcafe\n " ,
160161 }}
161162 tok , err := FetchCooldToken (context .Background (), fr , "h1" , "root" , 22 )
162- assert .NoError (t , err )
163+ require .NoError (t , err )
163164 assert .Equal (t , "deadbeefcafe" , tok )
164165}
165166
0 commit comments